SlideShare una empresa de Scribd logo
1 de 30
Beyond SOLID:
The Package Principles
Red Panda Innovation Labs
Code Words 2016-04-22
Christian Hujer
CEO / CTO Nelkinda Software Craft Pvt Ltd
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
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
1.
The Four Design Smells
The Four Design Smells
●Rigidity
●Fragility
●Immobility
●Viscosity
Rigidity
What is Rigidity?
Existing Code that causes Effort (known Effort)
What causes Rigidity?
Coupling
Fragility
●What is Fragility?
○Existing Code that causes Risk (unknown Effort)
●What causes Fragility?
○Coupling
○Lack of Cohesion
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
Viscosity
What is Viscosity?
Continuous extra Effort (Time)
What causes Viscosity?
Coupling
Bad development setup / tools
2.
The SOLID Principles
A short reminder
SRP - Single Responsibility
OCP - Open-Closed
LSP - Liskov Substitution
ISP - Interface Segregation
DIP - Dependency Inversion
Reminder of SOLID
Design Principles and Design
Patterns (2000)
Mentions 10 principles
● Principles of Object Oriented Class Design:
OCP, LSP, DIP, ISP
● Principles of Package Architecture:
REP, CCP, CRP, ADP, SDP, SAP
Origin of SOLID
3.
The Package Principles
The Package Principles
Package Cohesion Principles
REP - Release Reuse Equivalency
CCP - Common Closure
CRP - Common Reuse
Package Coupling Principles
ADP - Acyclic Dependencies
SDP - Stable Dependencies
SAP - Stable Abstractions
3.a.
Package Cohesion
Principles
Release Reuse Equivalency Principle
“The granule of reuse is the granule of release.”
Reuse === Release
Bundler / Gems, NPM, Jars / Maven, RPM,
APT, Brew...
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
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.”
3.b.
Package Coupling
Principles
Acyclic Dependencies Principle
“The dependencies between packages must
not form cycles.”
Stable Dependencies Principle
“Depend in the direction of stability.”
Stable Abstractions Principle
“Stable packages should be abstract
packages.”
3.c.
Mnemonics
How to remember all this stuff?!
ACCESS
Your new mnemonic acronym
Combine to SOLID ACCESS
ACCESS Mnemonic Acronym
ADP - Acyclic Dependencies
CCP - Common Closure (Cohesion Collocation)
CRP - Common Reuse
REP - Release Reuse Equivalency
SAP - Stable Abstractions
SDP - Stable Dependencies
CASE
A shorter mnemonic acronym
Combine to SOLID CASE
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
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)
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
Thank you!
Questions?
Follow me on Twitter:
@christianhujer

Más contenido relacionado

Similar a 2016-04-22: Beyond SOLID: The Package Principles

Software design principles
Software design principlesSoftware design principles
Software design principlesMd.Mojibul Hoque
 
Inversion of Control
Inversion of ControlInversion of Control
Inversion of ControlShuhab Tariq
 
Clean Code .Net Cheetsheets
Clean Code .Net CheetsheetsClean Code .Net Cheetsheets
Clean Code .Net CheetsheetsNikitaGoncharuk1
 
Tool Driven Restructuring of Large Codebases
Tool Driven Restructuring of Large CodebasesTool Driven Restructuring of Large Codebases
Tool Driven Restructuring of Large CodebasesCodeOps Technologies LLP
 
Favoring the Emergence through Agile Scaffolding
Favoring the Emergence through Agile ScaffoldingFavoring the Emergence through Agile Scaffolding
Favoring the Emergence through Agile ScaffoldingEmiliano Soldi
 
Dutch Symfony Meetup - Principles of PHP Package Design
Dutch Symfony Meetup - Principles of PHP Package DesignDutch Symfony Meetup - Principles of PHP Package Design
Dutch Symfony Meetup - Principles of PHP Package DesignMatthias Noback
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design patternMindfire Solutions
 
Design Pattern Explained CH8
Design Pattern Explained CH8Design Pattern Explained CH8
Design Pattern Explained CH8Jamie (Taka) Wang
 
SOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User GroupSOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User GroupAdnan Masood
 
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...SalesforceBY
 
Cohesion and Coupling - The Keys To Changing Your Code With Confidence
Cohesion and Coupling - The Keys To Changing Your Code With ConfidenceCohesion and Coupling - The Keys To Changing Your Code With Confidence
Cohesion and Coupling - The Keys To Changing Your Code With ConfidenceDan Donahue
 
Code Structural Analysis
Code Structural AnalysisCode Structural Analysis
Code Structural AnalysisEduards Sizovs
 
Code Structural Analysis
Code Structural AnalysisCode Structural Analysis
Code Structural AnalysisDmitry Buzdin
 
Mobilizing Citizen Engineers to Impact Complex Systems - RallyforImpact
Mobilizing Citizen Engineers to Impact Complex Systems - RallyforImpactMobilizing Citizen Engineers to Impact Complex Systems - RallyforImpact
Mobilizing Citizen Engineers to Impact Complex Systems - RallyforImpactRyan Martens
 
Dynamic Potential of Semantic Enrichment
Dynamic Potential of Semantic EnrichmentDynamic Potential of Semantic Enrichment
Dynamic Potential of Semantic Enrichmentpharley
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern RiverGlide
 

Similar a 2016-04-22: Beyond SOLID: The Package Principles (20)

Software design principles
Software design principlesSoftware design principles
Software design principles
 
Inversion of Control
Inversion of ControlInversion of Control
Inversion of Control
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Clean Code .Net Cheetsheets
Clean Code .Net CheetsheetsClean Code .Net Cheetsheets
Clean Code .Net Cheetsheets
 
Tool Driven Restructuring of Large Codebases
Tool Driven Restructuring of Large CodebasesTool Driven Restructuring of Large Codebases
Tool Driven Restructuring of Large Codebases
 
PMSE pdf
PMSE pdfPMSE pdf
PMSE pdf
 
Favoring the Emergence through Agile Scaffolding
Favoring the Emergence through Agile ScaffoldingFavoring the Emergence through Agile Scaffolding
Favoring the Emergence through Agile Scaffolding
 
Dutch Symfony Meetup - Principles of PHP Package Design
Dutch Symfony Meetup - Principles of PHP Package DesignDutch Symfony Meetup - Principles of PHP Package Design
Dutch Symfony Meetup - Principles of PHP Package Design
 
Let us understand design pattern
Let us understand design patternLet us understand design pattern
Let us understand design pattern
 
Design Pattern Explained CH8
Design Pattern Explained CH8Design Pattern Explained CH8
Design Pattern Explained CH8
 
SOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User GroupSOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User Group
 
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
Salesforce Meetup Grasp and Solid in Apex (Speakers: Alexander Popok and Kons...
 
Cohesion and Coupling - The Keys To Changing Your Code With Confidence
Cohesion and Coupling - The Keys To Changing Your Code With ConfidenceCohesion and Coupling - The Keys To Changing Your Code With Confidence
Cohesion and Coupling - The Keys To Changing Your Code With Confidence
 
Code Structural Analysis
Code Structural AnalysisCode Structural Analysis
Code Structural Analysis
 
Code Structural Analysis
Code Structural AnalysisCode Structural Analysis
Code Structural Analysis
 
Mobilizing Citizen Engineers to Impact Complex Systems - RallyforImpact
Mobilizing Citizen Engineers to Impact Complex Systems - RallyforImpactMobilizing Citizen Engineers to Impact Complex Systems - RallyforImpact
Mobilizing Citizen Engineers to Impact Complex Systems - RallyforImpact
 
Responsible innovation
Responsible innovationResponsible innovation
Responsible innovation
 
Managing Complexity
Managing ComplexityManaging Complexity
Managing Complexity
 
Dynamic Potential of Semantic Enrichment
Dynamic Potential of Semantic EnrichmentDynamic Potential of Semantic Enrichment
Dynamic Potential of Semantic Enrichment
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern
 

Más de Christian Hujer

How to improve your skills and how to apply for a job
How to improve your skills and how to apply for a jobHow to improve your skills and how to apply for a job
How to improve your skills and how to apply for a jobChristian Hujer
 
Vertical vs Horizontal Software Architecture
Vertical vs Horizontal Software ArchitectureVertical vs Horizontal Software Architecture
Vertical vs Horizontal Software ArchitectureChristian Hujer
 
Extreme Programming 2018 — Agile Beyond Scrum
Extreme Programming 2018 — Agile Beyond ScrumExtreme Programming 2018 — Agile Beyond Scrum
Extreme Programming 2018 — Agile Beyond ScrumChristian Hujer
 
2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easierChristian Hujer
 
The “transformation priority premise”
The “transformation priority premise”The “transformation priority premise”
The “transformation priority premise”Christian Hujer
 

Más de Christian Hujer (7)

How to improve your skills and how to apply for a job
How to improve your skills and how to apply for a jobHow to improve your skills and how to apply for a job
How to improve your skills and how to apply for a job
 
Vertical vs Horizontal Software Architecture
Vertical vs Horizontal Software ArchitectureVertical vs Horizontal Software Architecture
Vertical vs Horizontal Software Architecture
 
Escaping the matrix
Escaping the matrixEscaping the matrix
Escaping the matrix
 
Extreme Programming 2018 — Agile Beyond Scrum
Extreme Programming 2018 — Agile Beyond ScrumExtreme Programming 2018 — Agile Beyond Scrum
Extreme Programming 2018 — Agile Beyond Scrum
 
2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier2016 10-04: tdd++: tdd made easier
2016 10-04: tdd++: tdd made easier
 
The “transformation priority premise”
The “transformation priority premise”The “transformation priority premise”
The “transformation priority premise”
 
Functional programming
Functional programmingFunctional programming
Functional programming
 

Último

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Último (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

2016-04-22: Beyond SOLID: The Package Principles