Become a senior architect first to understand the design pattern, before understanding, to understand the design principles, the original I ate this loss, a long time to someone asked me design principles, I am a dazed, not only design mode? And do not know the principle of design is like writing calligraphy, in italics is the founder, Vertical Road has vertical dew, etc., the official script has a silkworm head swallow tail and so on.
These "orders" follow the solid architecture principles. This set of object-oriented design principles, through practice summarized as
1), SRP (single Responsibility Principle): Principle of sole responsibility;
A class should take care for only one responsibility. A single class has and has only a function.
2), OCP (open Closed Principle): Open closure principle;
Extension should is preferred over modification. The extension is open, and the modification is encapsulated.
3), LSP (Liskov Substitution Principle): the Richter replacement principle;
Objects seamlessly (seamless) during runtime polymorphism (polymorphic, polymorphic). Subclasses and parent classes have the same behavior and state.
4), ISP (Interface segregation Principle): interface separation principle;
Client should not being forced to using a interface if it does not need it. Interface separation rules are designed to work with multiple specific functions
Interface to avoid the redundancy caused by the common interface.
5), DIP (Dependency inversion Principle): dependency inversion principle;
The high level modules should is depend on the low level modules but the should depend on abstraction. The container is a rule, and the object only cares about the part that it completes.
Design principles of Design Patterns C #