Microservices are an architectural approach based on building an application as a collection of small services.
The service will store the business rule of your application, that is, everything that is very specific within your application.
SOLID stand for:
- S - Single responsibility principle
- O - Open closed principle
- L - Liskov substitution principle
- I - Interface segregation principle
- D - Dependency Inversion principle
Principle of Single Responsibility ⇒ A class must have one, and only one, reason for changing.
Open / Closed Principle ⇒ You must be able to extend a class's behavior without having to modify it.
Liskov substitution principle ⇒ Derived classes must be substitutable for their base classes.
Principle of interface segregation ⇒ Many specific interfaces are better than a single general interface.
Dependency inversion principle ⇒ Depend on abstractions, not implementations.
- Easy maintenance, understanding and organization;
- Open architecture to receive updates, improvements and new features without collateral damage
- Application of tests in an easy and simple way
- Easy code reuse
- Easy adaptation to changes in the scope of the project
- Code repetition, that is, a simple change must be replicated in several different points of its application
- Code without cohesive or standardized structure
- Rigidity and fragility, that is, any change causes a cascade of operations or failures in various parts of the system
- Difficulty performing and creating tests
- No reuse, that is, no or almost no functionality can be reused for other systems