Ad Code

Coupling Vs Cohesion

Can we say that coupling is determined by Aggregation relationship between ojects; whereas, Cohesion is dependent upon the composition relationship between the objects?


To some extent, we can say that coupling is determined by Aggregation because Aggregation reduces the number of objects that must be visible at the level of enclosing objects and it may lead to undesirable tighter coupling among objects. Whereas, cohesion is a measure of how strongly-related or focused the responsibilities of a single module are. Composition is again specialize form of Aggregation. In case of Composition relation, the relating objects cannot live independent of each other. For example, a class contains students. A student cannot exist without a class. There exists composition between class and students. In cohesion, modules can exist independently so we cannot conclude that cohesion is dependent upon composition.
Reactions

Post a Comment

0 Comments