S.O.L.I.D is the acronym for several important coding principles (programming Priciple) in object-oriented design and programming (Ood&oop).
SRP |
the single Responsibility principle |
single responsibility principle |
OCP |
the Open Closed principle |
|
LSP |
The Liskov Substitution Principle |
Richter substitution principle |
DIP |
the Dependency inversion Principle |
dependency inversion principle |
ISP |
the Interface segregation Principle |
interface separation principle |
Steve Smith has a solidify Your ASP at Microsoft TechEd 2009 in May, Derick.bailey's solid development principles–in Motivationa L Pictures A good explanation of the solid principle.
Single Responsibility Principle: Not that you can do it, you should do it
There is only one reason when a class needs to be modified (there should never is more THAN A-REASON for a class-to-change). In other words, to have a class take only one type of responsibility, this class needs to be decomposed when the class takes on other types of responsibility.
Open Closure principle wear a jacket don't do open chest surgery
Software entities should be extensible and non-modifiable. In other words, the extension is open, and the modification is closed. This principle is one of the most abstract and difficult to understand in many object-oriented programming principles.
Richter Replacement Principle if it looks like a duck, the sound sounds like a duck, but it needs a battery--then you're probably wrong.
When an instance of a subclass should be able to replace any instance of its superclass, there is a is-a relationship between them
dependency Inversion principle will you connect the light bulb directly to the wire in the wall?
1. High-level modules should not be dependent on low-layer modules, both should be dependent on abstract
2. Abstractions should not be dependent on detail, and details should be dependent on abstraction
interface Separation principle do you want me to plug it in and plug it in?
You cannot force users to rely on interfaces that they do not use. In other words, using multiple specialized interfaces is better than using a single total interface.
These principles are very basic and important object-oriented design principles. It is because of the fundamental nature of these principles that understanding and integrating these principles requires a lot of experience and knowledge. The above picture is a good commentary on these principles.
Go Solid development Principles-Object oriented