Subscribe by Email


Saturday, February 19, 2011

Component Level Design - Designing Class based Components - Coupling

The complexity of the system increases as the amount of collaboration and communication increases. As the complexity increases, difficulty in implementing, testing, and maintaining software also increases.

Coupling is a qualitative measure of the degree to which classes are connected to each other. Coupling increases as the classes become more dependent on each other. The main objective of component level design is to minimize coupling as much as possible.

As the design for each software component is elaborated, the focus shifts to the design of specific data structures and procedural designs to manipulate the data structures. There are different categories of coupling :

- Content Coupling
Content coupling is when one module modifies or relies on the internal workings of another module. This violates the basic design concept i.e. information hiding.
- Common Coupling
In common coupling, two modules share the same global data. It can lead to uncontrolled error propagation and side effects.
- Control Coupling
In Control coupling, one module controls the flow of other module. The problem is that an unrelated change in second module can result in the change of the meaning of control flag.
- External Coupling
Two modules share an external data format. A component communicates or collaborates with infrastructure components. It is necessary but should be limited to small number of components or classes.
- Data Coupling
Data coupling is when modules share data through. The bandwidth of communication grows and the complexity also increases.
- Stamp Coupling
In this type of coupling, modules share a composite data structure. It occurs when class B is declared as an argument of an operation of class A and therefore the system becomes more complex.
- Routine Call Coupling
It occurs when one operation invokes another. This type of coupling is quite necessary but it does increase the interconnectedness of a system.
- Type Use Coupling
It occurs when component A uses a data type in component B. If the type definition changes, every component that uses the definition also changes.
- Inclusion Coupling
In this type of coupling, component A includes or imports a package or content of component B.


No comments:

Facebook activity