Professional Documents
Culture Documents
LECTURE-33
Low Coupling– High Cohesion –
Controller
By
Mrs. T.Vinothini
AP/CSE
• Harder to reuse because its use requires the additional presence of the
classes on which it is dependent.
• For example, a J2EE application can safely couple itself to the Java
libraries (java.util, and so on), because they are stable and
widespread.
• convenient to reuse
• Protected Variation.
Problem
1. hard to comprehend
2. hard to reuse
3. hard to maintain
• Like Low Coupling, High Cohesion is a principle to keep in mind during all
design decisions; it is an underlying goal to continually consider.
2. Low cohesion
A class has sole responsibility for a complex task in one functional area.
4. Moderate cohesion
• Coupling and cohesion are old principles in software design; designing with
objects does not imply ignoring well established fundamentals.
• To quote:
• One case is the grouping of responsibilities or code into one class or component to
simplify maintenance by one personal though be warned that such grouping may
also worsen maintenance.
• Another case for components with lower cohesion is with distributed server objects.
• Low Coupling
• High Cohesion