Cohesion and Coupling: Two OO Design Principles
June 26, 2008
4 comments
Cohesion and Coupling deal with the quality of an OO design. Generally, good OO design calls for loose coupling and high cohesion. The goals of OO designs are to make the application
- Easy to Create
- Easy to Maintain
- Easy to Enhance
Coupling:
Coupling is the degree to which one class knows about another class. Let us consider two classes class A and class B. If class A knows class B through its interface only i.e it interacts with class B through its API then class A and class B are said to be loosely coupled.
