Loose coupling
Encyclopedia
In computing
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...

 and systems design
Systems design
Systems design is the process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. One could see it as the application of systems theory to product development...

 a loosely coupled system is one where each of its components has, or makes use of, little or no knowledge of the definitions of other separate components. The notion was introduced into organizational studies
Organizational studies
Organizational studies, sometimes known as organizational science, encompass the systematic study and careful application of knowledge about how people act within organizations...

 by Karl Weick
Karl Weick
Karl E. Weick is an American organizational theorist who is noted for introducing the notions of "loose coupling", "mindfulness", and "sensemaking" into organizational studies. He is the Rensis Likert Distinguished University Professor at the Ross School of Business at the University of Michigan...

. Sub-areas include the coupling of classes, interfaces, data, and services.

In electronics
Electronics
Electronics is the branch of science, engineering and technology that deals with electrical circuits involving active electrical components such as vacuum tubes, transistors, diodes and integrated circuits, and associated passive interconnection technologies...

 an inductively
Induction
-General use:* Induction , induction of childbirth* Rite of passage** Introduction of an individual into a body such as the armed forces** Formal introduction of a priest into possession of the position to which she or he has been presented and instituted...

 coupled circuit
Coupling (electronics)
In electronics and telecommunication, coupling is the desirable or undesirable transfer of energy from one medium, such as a metallic wire or an optical fiber, to another medium, including fortuitous transfer....

 with a low coupling coefficient is often called loosely coupled.

In computing

Coupling refers to the degree of direct knowledge that one class has of another. This is not meant to be interpreted as encapsulation vs. non-encapsulation. It is not a reference to one class's knowledge of another class's attributes or implementation, but rather knowledge of that other class itself.

Strong coupling occurs when a dependent class contains a pointer directly to a concrete class which provides the required behavior. The dependency cannot be substituted, or its "signature" changed, without requiring a change to the dependent class. Loose coupling occurs when the dependent class contains a pointer only to an interface, which can then be implemented by one or many concrete classes. The dependent class's dependency is to a "contract" specified by the interface; a defined list of methods and/or properties that implementing classes must provide. Any class that implements the interface can thus satisfy the dependency of a dependent class without having to change the class. This allows for extensibility in software design; a new class implementing an interface can be written to replace a current dependency in some or all situations, without requiring a change to the dependent class; the new and old classes can be interchanged freely. Strong coupling does not allow this.

This is a UML
Unified Modeling Language
Unified Modeling Language is a standardized general-purpose modeling language in the field of object-oriented software engineering. The standard is managed, and was created, by the Object Management Group...

 diagram (created in IBM Rhapsody
Telelogic Rhapsody
Now called IBM Rational Rhapsody, a modeling environment based on UML, Rhapsody is a visual development environment for systems engineers and software developers creating real-time or embedded systems and software...

) illustrating an example of loose coupling between a dependent class and a set of concrete classes, which provide the required behavior:
For comparison, this diagram illustrates the alternative design with strong coupling between the dependent class and a provider:

Measuring data element coupling

The degree of the loose coupling can be measured by noting the number of changes in data element
Data element
In metadata, the term data element is an atomic unit of data that has precise meaning or precise semantics. A data element has:# An identification such as a data element name# A clear data element definition# One or more representation terms...

s that could occur in the sending or receiving systems and determining if the computers would still continue communicating correctly. These changes include items such as:
  1. adding new data elements to messages
  2. changing the order of data elements
  3. changing the names of data elements
  4. changing the structures of data elements
  5. omitting data elements

Methods for decreasing coupling

Loose coupling of interfaces can be dramatically enhanced when publishers of data transmit messages using a flexible file format such as XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

 to enable subscribers to publish clear definitions of how they subsequently use this data. For example, a subscriber could publish the collection of statements used to extract information from a publisher's messages by sharing the relevant XPath
XPath
XPath is a language for selecting nodes from an XML document. In addition, XPath may be used to compute values from the content of an XML document...

 expressions used for data transformation. This would allow a responsible data publisher to test whether their subscriber's extraction methods would fail when a published format changes.

Loose coupling of services can be enhanced by reducing the information passed into a service to the key data. For example, a service that sends a letter is most reusable when just the customer identifier is passed and the customer address is obtained within the service. This decouples services because services do not need to be called in a specific order (e.g. GetCustomerAddress, SendLetter)

Note that loose coupling is not universally positive. If systems are de-coupled in time using Message-oriented middleware
Message-oriented middleware
Message-oriented middleware is software or hardware infrastructure supporting sending and receiving messages between distributed systems. MOM allows application modules to be distributed over heterogeneous platforms and reduces the complexity of developing applications that span multiple...

, it is difficult to also provide transactional integrity. Data replication across different systems provides loose coupling (in availability), but creates issues in maintaining synchronisation.

See also

  • Coupling (computer science)
    Coupling (computer science)
    In computer science, coupling or dependency is the degree to which each program module relies on each one of the other modules.Coupling is usually contrasted with cohesion. Low coupling often correlates with high cohesion, and vice versa...

  • Cohesion (computer science)
    Cohesion (computer science)
    In computer programming, cohesion is a measure of how strongly-related each piece of functionality expressed by the source code of a software module is...

  • XML
    XML
    Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

  • Web Services
  • Design pattern (computer science)
    Design pattern (computer science)
    In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that...

  • ISO/IEC 11179
    ISO/IEC 11179
    ISO/IEC 11179 is an international standard for representing metadata for an organization in a metadata registry.- Intended purpose :...

     - metadata registry specification
  • Data element
    Data element
    In metadata, the term data element is an atomic unit of data that has precise meaning or precise semantics. A data element has:# An identification such as a data element name# A clear data element definition# One or more representation terms...

  • Enterprise service bus
    Enterprise service bus
    An enterprise service bus is a software architecture model used for designing and implementing the interaction and communication between mutually interacting software applications in Service Oriented Architecture...

  • Enterprise Messaging System
    Enterprise messaging system
    An enterprise messaging system is a set of published Enterprise-wide standards that allows organizations to send semantically precise messages between computer systems. EMS systems promote loosely coupled architectures that allow changes in the formats of messages to have minimum impact on...

  • Space-based architecture
    Space-based architecture
    Space-Based Architecture is a software architecture pattern for achieving linear scalability of stateful, high-performance applications using the tuple space paradigm. It follows many of the principles of Representational State Transfer , service-oriented architecture and Event-driven...

     (SBA)

External links

  • The Joy of Flex (2005) by John Hagel III
    John Hagel III
    John Hagel or John Hagel III is an author and former consultant who specializes in the intersection of business strategy and information technology. In 2007, Hagel, along with John Seely Brown and Lang Davison, founded the Deloitte Center for Edge Innovation...

     and John Seely Brown
    John Seely Brown
    John Seely Brown is a researcher who specializes in organizational studies with a particular bent towards the organizational implications of computer-supported activities....

  • About SOA and loose coupling: How EDA extends SOA and why it is important Jack van Hoof
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK