<p>Can we achieve 100% decoupling between components of a system or different systems that communicate with each other? I don't think its possible. If two systems communicate with each other then there should be some degree of coupling between them. Am I right?</p>

[{'answer_id': 70472, 'author': 'Vadym Stetsiak', 'author_id': 6952, 'author_profile': 'https://Stackoverflow.com/users/6952', 'pm_score': 0, 'selected': False, 'text': "<p>You can achieve that. Think of two components that communicate with each other through network. One component can run on Windows while other on Unix. Isn't that 100% decoupling?</p>\n"}, {'answer_id': 70480, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 2, 'selected': False, 'text': '<p>If components are 100% decoupled, it means that they don\'t communicate with each other.</p>\n\n<p>Actually there are <a href="http://en.wikipedia.org/wiki/Coupling_%28computer_science%29" rel="nofollow noreferrer">different types of coupling</a>. But the general idea is that objects are not coupled if they don\'t depend on each other.</p>\n'}, {'answer_id': 70485, 'author': 'Sev', 'author_id': 83819, 'author_profile': 'https://Stackoverflow.com/users/83819', 'pm_score': 0, 'selected': False, 'text': "<p>At minimum, firewall protection, from a certain interface at least, needs to allow the traffic from each machine to go to the other.  That alone can be considered a form of 'coupling' and therefore, coupling is inherent to machines that communicate, at least to a certain level.</p>\n"}, {'answer_id': 70492, 'author': 'm_pGladiator', 'author_id': 446104, 'author_profile': 'https://Stackoverflow.com/users/446104', 'pm_score': 0, 'selected': False, 'text': '<p>This is achievable by introducing a communication interface or protocol which both components understand and not passing data directly between the components.</p>\n'}, {'answer_id': 70506, 'author': 'Quibblesome', 'author_id': 1143, 'author_profile': 'https://Stackoverflow.com/users/1143', 'pm_score': 0, 'selected': False, 'text': '<p>Well two webservices that don\'t reference each other might be a good example of 100% decoupled.\nThe coupling would then arrive in the form of an app util that "couples" them together by using them both.</p>\n\n<p>Coupling isn\'t inherently bad but you do have to make solid judgement calls about when to do it (is it only at Implementation, or in your framework itself?) and if the coupling is reasonable.</p>\n'}, {'answer_id': 70508, 'author': 'Ishmaeel', 'author_id': 227, 'author_profile': 'https://Stackoverflow.com/users/227', 'pm_score': 2, 'selected': False, 'text': "<p>Right. Even if you write to an interface or a protocol, you are committing to something. You can peacefully forget about 100% decoupling and rest assured that whatever you do, you cannot just snap out one component and slap another in its place without at least minor modifications anyway, unless you are committing to very basic protocols such as HTTP (and even then.)</p>\n\n<p>We human beings, after all, just LOOVE standards. That's why we have... well, nevermind.</p>\n"}, {'answer_id': 70539, 'author': 'xtofl', 'author_id': 6610, 'author_profile': 'https://Stackoverflow.com/users/6610', 'pm_score': 0, 'selected': False, 'text': '<p>If the components are designed to be 100% orthogonal, it should be possible.  A clear separation of concerns can achieve this.  All a component needs to know is the interface of its input.</p>\n\n<p>The coupling should be one-directional: components know the semantics of their parameters, but should be agnostic of each other.</p>\n\n<p>As soon as you have 1% coupling between components, the 1% starts growing (in a system which lasts a little longer)</p>\n\n<p>However, often knowledge is injected in peer components to achieve higher performance.</p>\n'}, {'answer_id': 70544, 'author': 'EricSchaefer', 'author_id': 8976, 'author_profile': 'https://Stackoverflow.com/users/8976', 'pm_score': 0, 'selected': False, 'text': '<p>Even if two components do not comunicate directly, the third component, which uses the other two is part of the system and it is coupled to them.</p>\n\n<p>@Vadmyst: If your components communicate over network they must use some kind of protocol which is the same as the interface of two local components.</p>\n'}, {'answer_id': 70546, 'author': 'Jon Davis', 'author_id': 11398, 'author_profile': 'https://Stackoverflow.com/users/11398', 'pm_score': 0, 'selected': False, 'text': '<p>That\'s a painfully abstract question to answer. If said system is the components of a single application, then there are various techniques such as those involving MVC (Model View Controller) and interfaces for IoC / Dependency Injection that facilitate decoupling of components.</p>\n\n<p>From the perspective of physically isolated software architectures, CORBA and COM support local or networked interop and use a "common tongue" of things like ATL. These have been deprecated by XML services such as SOAP, which uses WSDL for performing coupling. There\'s nothing that stops a SOAP client from using a WSDL for run-time late coupling, although I rarely see it. Then there are things like JSON, which is like XML but optimized, and Google Protocol Buffers which optimizes the interop but is typically precompiled and not late-coupled.</p>\n\n<p>When it comes to IPC (interprocess communications), two systems need only to speak a common "protocol". This could be XML, it could be a shared class library, or it could be something proprietary. Even at the proprietary level, you\'re still "coupled" by memory streams, TCP/IP networking, shared file (memory or hard disk), or some other mechanism, and you\'re still using bytes, and ultimately 1\'s and 0\'s.</p>\n\n<p>So ultimately the question really cannot be answered fairly; strictly speaking, 100% is only attained by systems that have zilch to do with each other. Refine your question to a context.</p>\n'}, {'answer_id': 70556, 'author': 'Steve Cooper', 'author_id': 6722, 'author_profile': 'https://Stackoverflow.com/users/6722', 'pm_score': 0, 'selected': False, 'text': "<p>It's important to distinguish between direct, and indirect components. Strive to remove direct connections (one class referencing another) and to use indirect connections instead. Bind two 'ignorant' classes with a third which manages their interactions.</p>\n\n<p>This would be something like a set of user controls sitting on a form, or a pool of database connections and a connection pooling class. The more fundamental components (controls and connections) are managed by the higher piece (form and connection pool), but no fundamental component knows about another. The fundamental components expose events and methods, and the other piece 'pulls the strings'.</p>\n"}, {'answer_id': 70563, 'author': 'Konrad Rudolph', 'author_id': 1968, 'author_profile': 'https://Stackoverflow.com/users/1968', 'pm_score': 0, 'selected': False, 'text': '<p>No, we can\'t. Read Joel\'s excellent article <a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html" rel="nofollow noreferrer">The Laws of Leaky Abstraction</a>, it is an eye-opener for many people. However, this isn\'t necessarily a <em>bad</em> thing, it just is. Leaky abstractions offer great opportunity because they make the underlying platform exploitable.</p>\n'}, {'answer_id': 1256528, 'author': 'Thomas Hansen', 'author_id': 29746, 'author_profile': 'https://Stackoverflow.com/users/29746', 'pm_score': 0, 'selected': False, 'text': '<p>Think of the API very hard for a very long time, then make sure it\'s as small as it can possibly be, until it\'s at the place where it has almost disappeared...</p>\n\n<p>The <a href="http://ra-ajax.org/LegoProcess.aspx" rel="nofollow noreferrer">Lego Software Process</a> proposes this ... :) - and actually quite well achieves this...</p>\n\n<p>How "closely coupled" are two cells of an organism...?</p>\n\n<p>The cells in an organism can still communicate, but instead of doing it by any means that requires any knowledge about the receiving (or sending) part, they do it by releasing chemicals into the body ... ;)</p>\n'}]
['https://Stackoverflow.com/questions/70460', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1688440/']