design patterns elements of reusable object oriented software book pdf
design patterns elements of reusable object oriented software book pdf
Read about design patterns elements of reusable object oriented software book pdf, The latest news, videos, and discussion topics about design patterns elements of reusable object oriented software book pdf from alibabacloud.com
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 as warning bells. If you violate one of them, the warning bells will ring ."
---------- Arthur J. Riel
(1) All data should be hidden i
is transformed into a derived class.(49) Do not model the dynamic semantics of a class by inheriting relationships. Attempts to model dynamic semantics with static semantic relationships can result in switching types at run time.(50) Do not turn the object of the class into a derived class. Be careful with any derived class that has only one instance.(51) If you feel you need to create a new class at run time, take a step back and recognize that you
(string audiotype) { switch (audiotype.tolower ()) { case ("MP3"): PlayMp3 (); break; case ("wav"): playwav (); break; } } }
Naturally, you will find this design very bad. Because it does not provide a minimum scale for future changes in requirements. If your design turns out to be the case, then when you're overwhelmed by the overwhelming demand change, you might want to get the
your system. Be especially careful with classes whose names contain driver, Manager, System, Susystem. Plan an interface instead of implementing one.
Be careful with classes that have a large number of access methods defined in the public interface. A large number of access methods means that the relevant data and behavior are not centrally stored.
Be cautious about classes that contain too many non-communicating behaviors. Another manifestation of this problem is that many get and set func
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
model the dynamic semantics of classes. If you try to use a static semantic relationship to model dynamic semantics, the type will be switched during runtime.
(50) do not convert the class object into a derived class. Be careful with any Derived classes that only have one instance.
(51) If you think you need to create a new class at runtime, take a step back to recognize that you want to create an object
the dynamic semantics of classes. If you try to use a static semantic relationship to model dynamic semantics, the type will be switched during runtime.
(50) do not convert the class object into a derived class. Be careful with any Derived classes that only have one instance.
(51) If you think you need to create a new class at runtime, take a step back to recognize that you want to create an object. No
relationship to model dynamic semantics, the type will be switched during runtime.
(50) do not convert the class object into a derived class. Be careful with any Derived classes that only have one instance.
(51) If you think you need to create a new class at runtime, take a step back to recognize that you want to create an object. Now, we can generalize these objects into a class.
(52) it should be illegal
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
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
inheritance relationships to model the dynamic semantics of classes. If you try to use a static semantic relationship to model dynamic semantics, the type will be switched during runtime.
Do not convert the class object into a derived class. Be careful with any Derived classes that only have one instance.
If you think you need to create a new class at runtime, take a step back to recognize that you want to create an
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
inheritance. Model the optional include into a class that inherits and can cause flooding. P108(54) try to create reusable frameworks rather than reusable components when creating an inheritance hierarchy. P112(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. P120(56) as
into an inheritance hierarchy, and each property value is transformed into a derived class.(49) do not use inheritance relationships to model the dynamic semantics of classes. If you try to use a static semantic relationship to model dynamic semantics, the type will be switched during runtime.(50) do not convert the class object into a derived class. Be careful with any Derived classes that only have one instance.(51) If you think you need to create
semantic relationship to model dynamic semantics, the type will be switched during runtime.
(50) do not convert the class object into a derived class. Be careful with any Derived classes that only have one instance.
(51) If you think you need to create a new class at runtime, take a step back to recognize that you want to create an object. Now, we can generalize these objects into a class.
(52) it should b
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
The design is the software realization based on the analysis model, divides into the system design and the detailed design two important stages, occupies the modularization, the coupling degree and the cohesion, the reusability principle. Software architecture is the key to the success or failure of a system, including warehouses, hierarchies, MVC, client/server,
Object | concept | design
In object-oriented design and implementation, we must spend time and energy figuring out these concepts: abstraction, encapsulation, inheritance, and polymorphism to
and object-
1. To learn the design mode, first understand what the design mode is:
1. What is the design model?
The design pattern describes a general solution to a type of common problems in the software design process.
2. What is an object-
Three books
The day before yesterday, I went to Shucheng and spent a lot of effort to buy three books :《CodeDaquan (second edition), ASP. Network 2.0 Development Guide and object-oriented system analysis and design ( UML For object-oriented system analysis and
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.