Clean Architecture - Component Principles (Part 3)

Search for a command to run...

No comments yet. Be the first to comment.
1. Sạch Phải công nhận là Sing sạch, đi đâu cũng thấy có người đang quét dọn, tỉa cành, gom rác, cắt cỏ,… Chi phí để duy trì môi trường cảnh quan chắc cũng không hề nhỏ. 2. Giao thông công cộng Bên này chủ yếu đi bằng tàu điện (MRT) và xe bus, chi ph...
In the previous article, I covered the basic concepts and introduced a 5-step process for applying DDD in practice. Today, I will bring you a bigger challenge. In this article, we will work through an

I. Why DDD matters? A Bigger Picture Over the years, as business needs have grown increasingly complex, our application systems have evolved - from monoliths to SOA, and now to microservices. This evolution demands a rational approach to component de...

Behind every robust software system lies a suite of well-structured unit tests. But what defines a great unit test? In this article, we’ll examine its anatomy and best practices to ensure your tests are both reliable and effective. I. A Bigger Pictur...

This is a nice feedback from my Singaporean Scrum Master for 2024. According to Vietnamese beliefs, 2024 marked the final year of a challenging three-year period (Tam Tai) for those born in 1996, a time filled with uncertainties and difficulties. Al...
You could follow the previous posts here:
If the SOLID principles tell us how to arrange the bricks into walls and rooms, then the component principles tell us how to arrange the rooms into buildings.
Components are the units of deployment. They are the smallest entities that can be deployed as part of a system. In Java, they are jar files. In Ruby, they are gem files. In .Net, they are DLLs.
Focus on the granularity of components and help the developer partition classes into components.
Uncle Bob gave us three principles of component cohesion:

Focus on the stability and relationship between the components

with Fan-in : Incoming dependencies, Fan-out : Outgoing depenencies
with Abstractness A = Number of abstract classes and interfaces / number of classes
Dependencies run in the direction of abstraction
Uncle Bob also give us the concept Zones of Exclusion

with:
=> cannot be extended because it is not abstract, very difficult to change because of its stability.
=> such components are useless :)))
Good architects strive to position the majority of their components at endpoints on the Main Sequence.
=> But in reality, those components have the best characteristics if they are on, or close, to the Main Sequence.
(to be continued