Please enable JavaScript.
Coggle requires JavaScript to display documents.
SOLID uses - Coggle Diagram
SOLID uses
Dependency Inversion
I use interfaces instead of concrete classes for attributes of the spring beans, and Spring provides the specific implementation for it.
-
-
Instead of instantiate directly dependencies (tight coupling) we let Spring container to provide concrete implementations.
Single Responsibility
Data Access Layer - Repositories are intended to handling the logic of data access for a single entity.
Presentation Layer - Spring Controllers are focused on parsing input/output information about a single concern: users, customers, locations, orders, etc.
Service Layer - Services handle only business rules logic for specific concern: users, logs, orders, sites, etc.
Liskov Substitution
-
Square modifies both high and width whenever either changes, but rectangle defined those to be independent.
Interface Seggregation
Always try to define coesive interfaces, so all methods are related.
Interface pollution: I try to avoid put unrelated methods in interfaces so clients are not forced to give an empty implementation.
-