0% found this document useful (0 votes)
6 views4 pages

D1: Coupling and Cohesion

Uploaded by

netom48542
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

D1: Coupling and Cohesion

Uploaded by

netom48542
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

D1: Coupling and Cohesion

Learning Goals

✤ To describe the principle of cohesion

✤ To describe the principle of coupling

✤ To refactor a system to reduce coupling and improve


cohesion

✤ To identify instances of high coupling and/or poor


cohesion in software design
Cohesion

✤ Cohesion: The Single Responsibility Principle

✤ Each class should have one, clearly defined purpose


Coupling

✤ A measure of the degree to which one part of the


system depends on other parts of the system. Shows
up when a change in one class results in another class
not compiling (so such cases show up in an obvious
way).

✤ For example, you have multiple classes that depend on


ClassA. Changing the signature of a method in ClassA
(e.g., changing the type of a parameter) will result in
classes that call that method not compiling.

You might also like