Reprise: The four design smells (Rigidity, Fragility, Immobility, Viscosity)
SOLID reprise: Quick overview of the first five principles
SRP Update: It's not just about classes!
Package Cohesion Principles:
* Release-Reuse Equivalency Principle (REP)
* Common Closure / Cohesion Collocation Principle (CCP)
* Common Reuse Principle (CRP)
Package Coupling Principles:
* Acyclic Dependencies Principle (ADP)
* Stable Dependencies Principle (SDP)
* Stable Abstractions Principle (SAP)
Mnemonics for remembering them: ACCESS, CASE
And don't forget Robert "Uncle Bob" C. Martin!
This is the original Google Drive slides:
https://docs.google.com/a/nelkinda.com/presentation/d/1yEOCYWhIgMfiDAJYtvB5ongE2qvcA91tPqLB4TzEcwM/edit?usp=sharing
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
2016-04-22: Beyond SOLID: The Package Principles
1. Beyond SOLID:
The Package Principles
Red Panda Innovation Labs
Code Words 2016-04-22
Christian Hujer
CEO / CTO Nelkinda Software Craft Pvt Ltd
2. Agenda
1.The Four Design Smells
2.Origins and Reprise of SOLID
3.ACCESS / CASE - The Package Principles
a.Package Cohesion Principles
b.Package Coupling Principles
c.Mnemonics
3. Definitions
Software Entity
Statement / line / method / class / package / service
Component
Logical (model / architecture / design) group of Software Entities
Package
Physical (e.g. directory, gem, jar) group of Software Entities
Collocation
Putting things in the same Component / Package
Cohesion
Things that are changed together
Coupling
Dependency that potentially propagates change
8. Immobility
What is Immobility?
The difficulty (extra Effort) to reuse something.
Rigidity and Fragility in the context of reuse.
What causes Immobility?
Coupling
Lack of Cohesion
16. Release Reuse Equivalency Principle
“The granule of reuse is the granule of release.”
Reuse === Release
Bundler / Gems, NPM, Jars / Maven, RPM,
APT, Brew...
17. Common Closure Principle (Cohesion)
“Classes that change together belong
together.”
⇒ This also is a nice pragmatic definition of
cohesion and that cohesive elements should be
collocated.
I call it: Cohesion Collocation Principle
18. Common Reuse Principle (Cohesion)
“Classes that aren’t reused together should not
be grouped together.”
This is really the inversion of the idea that
“Classes that change together belong
together.”
27. CASE - A new mnemonic acronym
Cohesion / Common
CCP / CRP Common Closure / Reuse
Acyclic
ADP Acyclic Dependencies
Stability
SAP / SDP Stable Abstractions / Dependencies
Equivalence
REP Release Reuse Equivalency
28. Related Topics
Software Architecture and Design
Software Metrics
Clean Code
Refactoring
TDD, ATDD and BDD
Agile Methods, Scrum, Extreme Programming
Continuous Integration / Delivery / Deployment, DevOps
Software Craftsmanship
Law of Demeter / Tell Don’t Ask
CQS - Command Query Separation
Programming Paradigms (Functional, Structured, Object-Oriented, Object-
Functional, Logic)
29. References
● SOLID and Package Principles, Design Smells: Design
Principles and Design Patterns (Robert C. Martin, 2000)
● ACCESS mnemonic: Christian Hujer
● CASE mnemonic: Christian Hujer and Mark Burns