Coupling, Cohesion and the Law of Demeter

Grady Booch in “Object Oriented Analysis and Design”: “The idea of cohesion also comes from structured design. Simply stated, cohesion measures the degree of connectivity among the elements of a single module (and for object-oriented design, a single class or object). The least desirable form of cohesion is coincidental cohesion, in which entirely unrelated abstractions … Read more

What is the difference between loose coupling and tight coupling in the object oriented paradigm?

Tight coupling is when a group of classes are highly dependent on one another. This scenario arises when a class assumes too many responsibilities, or when one concern is spread over many classes rather than having its own class. Loose coupling is achieved by means of a design that promotes single-responsibility and separation of concerns. … Read more