Clean Architecture - Components and Component Cohesion

Topics covered
Popular Clips
Episode Highlights
Reuse Principle
The Common Reuse Principle emphasizes not forcing users to depend on unnecessary components. Michael Outlaw explains how this principle is often violated, leading to bloated dependencies that complicate simple tasks 1. Joe Zack illustrates this with an example where an email client unnecessarily depends on a logging client, dragging along unrelated dependencies 1. Alan Underwood discusses the dilemma of refactoring code, where breaking projects into smaller components can lead to additional complexities like build orders and versioning 2.
There should be a don't make mistakes principle, but it's still just the idea of this email code. It's got a very specific functionality and it's now it's being tied with this other stuff. And so anytime you need one, the other comes along.
--- Joe Zack
Balancing these dependencies is crucial for maintaining clean and efficient code.
  Â
Versioning
The Release Equivalence Principle focuses on proper versioning and documentation for shared software components. Joe Zack highlights the importance of having distinct release numbers for each component to avoid unnecessary dependencies 3. Michael Outlaw and Alan Underwood discuss the merits of semantic versioning, emphasizing its role in ensuring compatibility and clarity for both developers and end-users 4.
If you use something like semantic versioning, it's very easy to reason about just looking at the numbers, assuming that people aren't, you know, lying and fudging about their numbers.
--- Michael Outlaw
Proper versioning practices help maintain the integrity and usability of software components.
  Â
Closure Principle
The Common Closure Principle advises bundling classes that change for the same reason and at the same time. Joe Zack explains that this principle helps minimize the impact of changes by keeping related classes together 5. He also connects this principle to the Common Reuse Principle, emphasizing the importance of separating unrelated functionalities to avoid unnecessary dependencies 1.
Gather together those things that change at the same times and for the same reason. Separate those things that change at different times or for different reasons.
--- Michael Outlaw
This approach ensures that changes are localized, reducing the risk of widespread issues.
  Â
Tension Triangle
The Tension Triangle illustrates the balance between the three cohesion principles: reuse, release equivalence, and closure. Michael Outlaw describes how focusing on one principle can impact the others, creating a dynamic balance that shifts throughout a project's lifecycle 6. Joe Zack elaborates on the costs associated with neglecting each principle, emphasizing the need for a balanced approach 7.
The key is trying to find a balance between these things, because there's no perfect scenario. Right. Like, there never is.
--- Alan Underwood
Understanding this balance is crucial for effective software architecture.
Related Episodes


Clean Architecture - How to Quantify Component Coupling
Answers 383 questions

Clean Architecture - Make Your Architecture Scream
Answers 383 questions
Clean Architecture - Fight for Architecture
Answers 383 questions

Clean Architecture - Are Microservices Truly Decoupled?
Answers 383 questions

Clean Architecture - Programming Paradigms
Answers 383 questions

Clean Code - How to Build Maintainable Systems
Answers 383 questions
Clean Architecture - The Art of Drawing Lines
Answers 383 questions

Clean Architecture - Keeping Your Options Open
Answers 383 questions

Clean Code - How to Write Classes the Right Way
Answers 383 questions

Clean Architecture - What is the Humble Object Pattern?
Answers 383 questions

Clean Code - Comments Are Lies
Answers 383 questionsThe DevOps Handbook – Architecting for Low-Risk Releases
Answers 383 questions

Software Design Anti-patterns
Answers 383 questions

Site Reliability Engineering - Evolution of Automation
Answers 383 questions

Why Domain Driven Design
Answers 383 questions
