Please enable JavaScript.
Coggle requires JavaScript to display documents.
S.O.L.I.D - Coggle Diagram
S.O.L.I.D
Note
SOLID is not a panacea and you should not dogmatically follow it
Blindly following principles is something that young and inexperienced developers often do, they learn of a new methoddology or tool that seems like a good idea and they attach to it and try to use it for everything, even when it doesn't make sense
I
Interface Segregation Principle (ISP)
No cilent should be forced to depend on methods it does not use
ISP splits interfaces that are very large into smaller and more specific ones so that cilents will only have to know about the methods that are of interest to them
D
Dependency Inversion Principle (DIP)
Depend on abstraction not on concretions
Dependency Inversion is all about building classes that are created to use abstractions of 3rd party objects so that the concrete objects can be changed at will without needing to rewrite your code
S
Single Responsibility Principle (SRP)
A class should have one, and only one, reason to change
Think of this as a warning not to create god objects that try to do too many different things
L
Liskov Substitutuion Principle (LSP)
Derived classes must be substitutable for their base classes
The idea behind this principle is that code should be written such that if you create a new derived class from a base class you should not have to modify code to work with this derived class
O
Open-Closed Principle (OCP)
You should be able to extend a classes behavior, without modifying
This is all about using polymorphism and abstraction to build new functionality