Coupling and Cohesion - SYSC3020-Winter2016/SYSC3020LectureNotes GitHub Wiki

Coupling and cohesion are properties of subsystems in a software architecture.

Coupling

Coupling is a property that measures (quantifies) the dependency between two subsystems. Two subsystems A and B are highly (strongly, tightly) coupled if there are many dependencies between classes of A and classes of B.

The principle of reducing coupling between subsystems is Software Engineering Principles.

A dependency in this case is any kind of Object Relationships.

When subsystems are highly coupled, modifications of one subsystem are liekly to impact the other, which is detrimental to Software Engineering Principles.

In a software architecture, it is therefore important to minimize the coupling between subsystems.

One design pattern that can be used to reduce the coupling is the facade design pattern.

Cohesion

Cohesion is a property that can be measured on one subsystem. A subsystem is highly cohesive if:

  • the subsystem represents a functional whole (its responsibilities are conceptually closely related)
  • the classes within the subsystem have many dependencies to one another.
⚠️ **GitHub.com Fallback** ⚠️