Object-oriented design principlesBorn to support maintainability multiplexing, these principles are embedded in many design patterns, which are the guiding principles that are summarized in many design scenarios, and understand
Object-oriented design principlesHelps us understand design patterns, and design instructions are all derived from
Object-oriented design principles
Single responsibility principle of object-oriented design principle
A: A class is responsible only for the corresponding responsibilities in a functional area, or can be defined as: For a class, there should be only one cause for it to change
Open and close principle of object-oriented design principle
A: A software entity such as classes, modules, and functions should be open to extensions and closed for modification. That is, the software entity should try to extend without modifying the original code.
The principle of object-oriented design principle in the Richter scale substitution
A: All references to base classes (parent classes) must be able to transparently use objects of their subclasses.
Dependency reversal principle of object-oriented design principle
A: Abstractions should not be dependent on detail, and detail should be dependent on abstraction. In other words, you want to program for the interface, not for the implementation.
Interface isolation principle of object-oriented design principle
A: Use multiple specialized interfaces instead of a single total interface, that is, the client should not rely on interfaces that it does not need.
The principle of object-oriented design in synthetic multiplexing
A: Try to use object combinations rather than inheritance to achieve reuse
The principle of object-oriented design for the DISA rule
A: A software entity should interact with other entities as little as possible
Related recommendations:
Design of PHP object-oriented design and data accessibility
About PHP Object-oriented-class definition and instantiation of objects and special usage of construction and destructor-worship