Learn about solid principles of object oriented design, we have the largest and most updated solid principles of object oriented design information on alibabacloud.com
Three basic elements of object-oriented architecture: encapsulation, inheritance, and Polymorphism
Five basic object-oriented design principles:
Single-Resposibility Principle)
Its core idea is: A class. It is best to do only one
===================================== Another versionWhat are design principles?
Design principles are basic tools. applying these rules can make your code more flexible, easier to maintain, and easier to expand.Basic Principles
Encapsulation change Encapsulate what vari
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
1 OO design principlesThe use of object-oriented analysis and design ideas, for us to analyze and solve problems to provide a new way of thinking. After we get the demand (omit Ooa, complete later), the next question is: How to object-or
Three basic elements of object-oriented architecture: encapsulation, inheritance, and Polymorphism
Five basic object-oriented design principles:
Single-Resposibility Principle)
Its core idea is: A class, it is best to do only one
61 empirical principles of Object-Oriented Design
Excerpted from the log of OOD, translated by BaO zhiyun, Arthur J. Riel
"You do not have to strictly abide by these principles and violate them and are not subject to religious penalties. But you should
61 empirical principles of Object-Oriented Design
Author: Arthur J. Riel
"You do not have to strictly abide by these principles and violate them and are not subject to religious penalties. But you should regard these principles
reasons such as the need to modify the original code of the software, may introduce errors in the old code, or we will have to refactor the entire functionality, and the original code needs to be tested again. This has a special impact on our entire system, which also fully shows the coupling of the system if too high, will greatly increase the later expansion, maintenance. In order to solve this problem, people have summed up the principle of opening and closing. The fundamental solution to th
define a large number of access methods in the public interface. A large number of access methods means that the relevant data and behavior are not centrally stored.
(15) Be more careful with classes that contain too much communication behavior. P31
Another manifestation of this problem is the creation of many get and set functions in the public interface of the classes in your application.
(16) In an application composed of an object-
an empty method (that is, a method that does nothing) in the derived class.(53) do not confuse optional items with the requirements for inheritance. Model the optional include into a class that inherits and can cause flooding.(54) try to create reusable frameworks rather than reusable components when creating an inheritance hierarchy.(55) if you use multiple inheritance in the design, first assume that you have made a mistake. If you do not make a mi
Arthur J.riel once said that you do not have to strictly abide by these principles and will not be sentenced to religious punishment for violating them. But you should think of these principles as alarms, and if you violate one of them, the alarm will ring. So, whatever we do, we have to have a principle. Programming is no exception, the following describes
PHPThe principle of
the design.
(13) do not create all-powerful classes/objects in your system. Be especially careful about the classes whose names include driver, Manager, system, and susystem.
Plan an interface instead of implementing an interface.
(14) Be careful with classes that define a large number of access methods in public interfaces. A large number of access methods mean that related data and behaviors are not stored in a centralized manner.
(15) Be c
61 empirical principles of Object-Oriented Design
Excerpted from the good revelation-Arthur J. Riel
(1)All data should be hidden inside the class. P13
(2)The class user must be dependent on the common interfaces of the class, bu
Three basic elements of object-oriented architecture: encapsulation, inheritance, and Polymorphism
Five basic object-oriented design principles:
Single-Resposibility Principle)
Its core idea is: A class. It is best to do only one
direction as much as possible, that is, the top-level classes should share work in a unified manner according to the design.
(13) do not create all-powerful classes/objects in your system. Be especially careful about the classes whose names include driver, Manager, system, and susystem.Plan an interface instead of implementing an interface.
(14) Be careful with classes that define a large number of access methods in public interfaces. A large num
inheritance in the design, first assume that you have made a mistake. If you do not make a mistake, try to prove it.
(56) as long as inheritance is used in object-oriented design, I have two questions: (1) is the derived class a special type of the thing it inherits? (2) is the base class part of the derived class?
(5
a unified manner according to the design.
(13) do not create all-powerful classes/objects in your system. Be especially careful about the classes whose names include Driver, Manager, System, and Susystem. Plan an interface instead of implementing an interface.
(14) Be careful with classes that define a large number of access methods in public interfaces. A large number of access methods mean that related data and behaviors are not stored in a central
is, the top-level classes should share work in a unified manner according to the design. P30(13) do not create all-powerful classes/objects in your system. Be especially careful about the classes whose names include driver, Manager, system, and susystem. P30Plan an interface instead of implementing an interface.(14) Be careful with classes that define a large number of access methods in public interfaces. A large number of access methods mean that re
frameworks rather than reusable components when creating an inheritance hierarchy.
(55) If you use multiple inheritance in the design, first assume that you have made a mistake. If you do not make a mistake, try to prove it.
(56) as long as inheritance is used in object-oriented design, I have two questions: (1) i
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.