Communication Between Layers
Let’s learn about how communication is done between the layers of clean architecture.
We'll cover the following
The purpose of layers
As we move deeper into each layer in clean architecture, its content becomes more abstract. The inner layers contain representations of business concepts, while the outer layers contain specific details about real-life implementation. The communication between elements that live in the same layer is unrestricted. Still, when we want to communicate with elements that have been assigned to other layers, its important to follow one simple rule. If we’d like, we can refer to this as a golden rule. It’s one of the most important things in clean architecture and may even be considered to be its core expression.
The golden rule: Talk inward with simple structures, talk outward through interfaces.
Communication behavior
Our elements should talk inward. This means they should pass data to more abstract elements through the use of basic structures, entities, and so on.
Get hands-on with 1400+ tech skills courses.