Object-oriented programming in fact, we are explaining the concept of marriage
Object-Oriented Programming 5 principles, want to be the same as the object is the same:
Single responsibility Principle (SRP): To be a simple person, there will be simply "stable happiness-Eason Chan";
A class should have only one reason to cause it to change
Open closure principle (OCP): Understanding the past is not advice, know that the coming can still chase;
Open and closed, open to extensions, and closed to changes!
The Richter Replacement principle (LSP): The big radish can always be invincible;
Subclasses can replace the parent class and appear anywhere the parent class can appear, interface-oriented programming GOF
Dependency inversion principle (DIP): Love the economy must also be independent AH;
In traditional structured programming, the topmost modules are usually dependent on the following sub-modules, and
Called High-level dependency low! Dip to reverse this dependency, let the high-level module do not rely on the lower module
A. High-level modules should not be dependent on low levels of modules, they should all rely on abstraction.
B. Abstractions should not be dependent on specifics, but should be dependent on abstraction.
Interface isolation principle (ISP): Too much commitment brings only two people tired. Love don't make too many meaningless promises.
Using multiple dedicated interfaces is much better than using a single interface! The operation defined by the interface is equivalent to a commitment to the client, not too much commitment
The face of the object of Love Five Principles analysis!