Introduction
Architecture evolution is the mechanism of adjusting current software architecture to match new requirements. To help you understand how you might improve a solution that applies clean architecture, lets review some basic principles.
1.Dependency Inversion Principle
Flexible systems should have source code dependencies on abstractions and not concretions, see:
2.Component Principles
Components are the minimal units the can be deployed in a system.
Independently deployable components are usually well designed and could be independently developed.
3.Component Cohesion
Defining the classes that goes into components is a crucial decision see:
To tackle this issue we will consider three principles of components cohesion:
- The Reuse/Release Equivalence Principle - Those who want to reuse software components will choose not to, unless those components are tracked through a release process and are given release numbers. Developers should be aware of new releases, and what changes these new releases will bring.
- The Common Closure Principle - A component should not have multiple reasons to change.
- The Common Reuse Principle - Classes that are not tightly bound to each other should not be in the same component.
Clean Architecture
Clean architecture keeps the business logic and application model at the center of the application. To achieve this the infrastructure concerns depend on the domain of the application, see:
The main advantages of implementing clean architecture is that it allows applications to be loosely coupled. That gives developers the power to update infrastructure like frameworks and databases. It also allows for highly testable application.
Applied Principles to Clean Architecture
To implement and evolve a project that applies clean architecture, it is wise to understand the SOLID Principles, Component Principles and other knowledge available in uncle bobs clean architecture book. Lets go over a two of these principles:
Dependency inversion principle
when one applies the dependency inversion principle it enables infrastructure to be injected through at compile time and database can be included with more ease, see:
Reuse/Release Equivalence Principle
Applying the Reuse/Release Equivalence Principle in your infrastructure layer may allow developers to evolve each component independently from each other, see:
Conclusion
Implementing an architecture project requires knowledge to understand a specific pattern and applied it. Developers might face gaps when deciding when and why it would be necessary to create new components.
To successfully maintain and evolve the software projects, learning software design principles are a good starting point that developers should take into account.
For a more complete explanation of this post, with more details and diagrams checkout this youtube presentation.
References
- Martin, Robert C. Clean Architecture: A Craftsman's Guide to Software Structure and Design
- Steve Smith Architecting Modern Web Applications with ASP.NET Core and Microsoft Azure
- Clean Architecture | Theory and Concepts.
Top comments (0)