Sometimes designers find that they can focus on high cohesion, or they can focus on low
coupling, but not both. The first principle, high cohesion, means that everything in a class
is meant to work together. For example, a class to open a bank account wouldn't try to
handle a savings account opening and a checking account opening. High cohesion would
say those go into different classes. But low coupling says modules should not be dependent
on each other.
Discuss how having two different modules handling account opening could increase class
dependencies. Which way would you go: one class or two for opening accounts?
Get Free Quote!
318 Experts Online