Lecture 11: Designing With Components

Just as SOLID guides the design of individual classes or small groups of classes, there are an analogous set of principles that guide the design of individual components or groups of components.

This lecture introduces the concept of cohesion and discusses the Common Closure Principle (CCP): that classes in the same component should change at the same time, and for the same reasons. It also considers the Common Reuse Principle (CRP): that we should not force users of a component to depend on things that they don’t need.

Another concept explored here is the coupling that exists between components due to their dependencies on each other. The lecture discusses the Acyclic Dependencies Principle (ADP): that there should be no cycles in the component dependency graph. It also considers the Stable Dependencies Principle (SDP): that dependencies should run in the direction of increasing stability. Finally, it considers the Stable Abstractions Principle (SAP): that a component should be as abstract as it is stable.