Loose coupling

from Wikipedia, the free encyclopedia

In computer science, loose coupling denotes a low degree of interdependence between several hardware or software components. If a system is loosely coupled, changes to individual components can often be carried out more easily, since the change only has a local effect. If there were close 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 a slightly lower performance .

Taxonomy in multiprocessor systems

A distinction is made between multiprocessor systems in systems of loose coupling ( English loosely coupled ) and correspondingly tight coupling (English tightly coupled ).

A loosely coupled system is when data is transferred between two systems via I / O systems (network, data line).

The use of loosely coupled systems is geared towards dealing with distributed problems. One example of such a problem is factoring a very large number across multiple computers. Each computer would be assigned its own series of divisors for this number, try them out and finally send the result back to the main computer.

Software architecture

The term coupling has also established itself in software architecture and describes how closely the components of a software are connected to one another. In software architecture, the term cohesion is closely related to the term coupling . The aim for a software system is as loosely a coupling as possible between the components, as well as a strong bond (cohesion) within each component.

A loose coupling in the software architecture means that software components only communicate with other components via 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 facade 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 enlarge the interface of components and should therefore be avoided.

Loose coupling means that changes in one component only require changes in another component if the changes affect the interface. Loose coupling therefore has a direct influence on the maintainability of software.

See also

literature