In computer science, loose coupling refers to a low degree of dependence of several hardware or software components on each other. With loose coupling of a system, changes to individual components are often easier to carry out, since the change has only a local effect. If there were a tight coupling, the change would not remain local, but would require additional adjustments in all coupled components. In some cases, this advantage is offset by the disadvantage of slightly lower performance.
Multiprocessor systems are divided into loosely coupled systems and tightly coupled. A loosely coupled system is when data transmission between two systems takes place via I/O systems (network, data line). The use of loosely coupled systems is geared towards the processing of distributed problems. An example of such a problem is the factorization of a very large number spread over several computers. Each computer would be assigned its own set of divisors to this number, try them out and finally send the result back to the main computer.
Loose Coupling in Software Architecture
The term coupling has also established itself in software architecture, where it describes how closely the components of software are interconnected. Closely related to the term coupling in software architecture is the term cohesion. For a software system, one strives for the loosest possible coupling between the components, as well as a strong bond (cohesion) within each component.
In software architecture, loose coupling means that components of software communicate with other components via only a few interfaces or are dependent on other components. These components do not necessarily communicate across system boundaries, but usually within a software system. In this case, the façade design pattern describes how this can be implemented in software design. Global variables, public attributes, singletons or, for example, the storage of software states in a database automatically increase the interface of components and should therefore be avoided.
Loose coupling means that changes in one component only cause changes in another component if the changes affect the interface. Loose coupling therefore has a direct influence on the maintainability of software.
Loose coupling is a principle in service-oriented architectures. Enterprise Service Bus (ESB) middleware is designed for loose coupling in multiple dimensions.