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 careful with classes that contain too many non-communication behaviors. Another manifestation of this problem is in your application.ProgramMany get and set functions are created in the public interface of the class.
(16) In an application composed of an object-
included and associated relationships, select the included relationship. P123
(59)Do not use global data or global functions to note the work of class objects. Class variables or class methods should be used. P140
(60)Object-oriented designers should not allow physical design
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 careful with classes that contain too many non-communication behaviors.
Another manifestation of this problem is that many get and set functions are created in the public interfaces of classes in your application.
(16) In an application composed of an object-
) is the base class part of the derived class?
(57) If you find multiple inheritance relationships in an object-oriented design, make sure that no base class is actually a derived class of another base class.
(58) in the object-oriented
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?
(57) If you find multiple inheritance relationships in an object-oriented design, make sure that no base class is actually a derived class of another base class.
(58) in the object-
to minimize coupling
7, object-oriented common design principles: SOLID
Single principle of responsibility;
The principle of open closure;
Liskov substitution principle;
interface isolation principle;
dependency inversion principle;
Dimitri Law;
Synthesis/polymerization reuse prin
Labels: Object-oriented Design Principles
After the previous in-depth explanation, we have basically made it clear about the solid principle. However, if you want to skillfully apply the solid principle, it is not enough to know what the solid is, we also need to know when and when the solid principle is applied (when
is conceived out, so oriented to abstract design is in line with human thinking. In addition, this principle will be well supported by the OCP, and the abstraction-oriented design allows us to not rely too much on implementation, so that the extension becomes possible, and this principle is the cornerstone of another
the very beginning, I paid special attention to the knowledge of software design. The three books I have read here happen to reflect several aspects of software design and development:
Programming and Development: Design Patterns elements of reusable object-oriented
The design principle is a guiding and abstract concept. The design mode is a good practical experience to achieve the design principles.
After a while of object-oriented programming. The first thing to learn is the
will replace the Dataconvertor type object, and the program will not have any problems. Change the specific data conversion class without modifying the source code, only need to modify the configuration file, if you need to add a new concrete data transformation class, as long as the addition of data transformation class as a subclass of Dataconvertor and modify the download file structure, the original code does not need to make any changes to meet
before we start the Android software app, we need to make a preliminary understanding of object-oriented design principles and design patterns. Talent in the future combat process, less detours. Make our software development career feel happy and relaxed. Okay, nonsense, let
same way through a common class.These three characteristics are also the basis for understanding the five principles of object-oriented design.The Five principles of object-oriented design
describes how to implement the "open-closed" principle in the object-oriented design.
(1) interface-oriented programmingInterface-oriented programming has the following advantages:A. reduce coupling between various parts of the program and make it possible to swap program m
in object-oriented design, ask yourself two questions: (1) is the derived class A special type of the thing it inherits from? (2) is the base class part of a derived class?(57) If you find multiple inheritance relationships in an object-oriented
Recently in the "Head First design mode" is really a good book, in layman's terms, with specific scenes to the common design patterns are very thorough. Slightly sadly, the examples in this book are written in Java and written for us. NET seems to be a little bit uncomfortable. So I wrote the example of each pattern in the book in C #, and, by the way, made some
think about the design, rather than first dividing what classes I need, because these are specific. What are the benefits of doing so? Human thinking itself is actually very abstract. When we analyze the problem, we do not consider the details at once, but abstract the entire problem, therefore, abstract design is in line with human thinking. In addition, this principle will support OCP very well. Abstract
in public interfaces. A large number of access methods mean that related data and behaviors are not stored in a centralized manner.
(15) Be careful with classes that contain too many non-communication behaviors.
Another manifestation of this problem is that many get and set functions are created in the public interfaces of classes in your application.
(16) In an application composed of an object-oriented m
I'm just a bean before I know the 7 principles of object-oriented design! But the beans will eventually grow, don't they?1. Opening and closing principle : A software entity should open to the extension and close the modification. In other words, when a module is involved, it should be allowed to be extended without mo
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.