Coupling and Cohesion

Coupling and cohesion are two terms related to modular programming.

When we face a large problem it can be divided into smaller modules which can be easily designed, coded and debugged, by a group of different peoples. It also helps in load sharing.
Now there is a standard way to divide programs into modules, it is not just the code size or Line of Codes, it refers to an independent (as much as possible) and complete set of code.

Coupling is the interrelationship or interdependence of these individual modules. Conventionally coupling is should be least or zero in a system of program or software. However it might not be possible in some cases to achieve fully.

Cohesion is the interdependence or interrelationship between the elements or sub parts of a module. The elements of a module should be strongly dependent on each other , as they are the part of same system or module.

Coupling and cohesion are the important issues which must be considered while designing a system, as it helps in up-gradation of maintenance of the system. In a loosely coupled module changes can be easily done without much affecting the other modules in the system.

No comments:

Post a Comment