Alibabacloud.com offers a wide variety of articles about best object oriented design book, easily find your best object oriented design book information here online.
, structures and themesClass and object layer: How to build a basic blockAttribute layer: An object's properties and instance joinsService layer: The service of the object, plus the composition of the message communication between the object instancesStructural layer: Describes the general--special structure or generalization--specialization structure, generaliza
modification of the situation to expand the system function To meet the requirements of open and closed principle. The dependency inversion principle is one of the basic principles behind the technologies and frameworks of COM, CORBA, EJB, and spring.4. Combination/Aggregation multiplexing principleThe combination/aggregation multiplexing principle, also known as the synthetic multiplexing principle, is to use some existing objects in a new object by
Today, I read the second chapter object model of object-oriented analysis and design, from the first generation of computer to the evolution of object-oriented programming, has undergone a long evolution, while
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
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-
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-
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.
Program Many get and set functions are created in the public interface of the class.
(16) In an application composed of an object-oriented
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 design, I have two questions: (1) i
/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.
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.
Be careful with classes that contain too many non-communication behaviors. Another manifestation of this problem is
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
. The Notice package contains all command objects that process cache update notifications. The factory package contains the c‑factory class, this class generates the corresponding subclass object of the ccommand Class Based on the message header.
The program code in the main package uses the ccommand class and the ccommandfactory class, so it inherits the creadcommand class according to the internal command package and internal factory; the class in
1. An important experience for Object-Oriented Design:
Anyone who owns the data provides external operations on the data.
2. Object-oriented refining experience:
Term refining method.
Case:1. Draw circles on the blackboard
Through this sentence, it is easy to think of the ob
.
During program design, we should always consider the best class design as much as possible, and do not modify it if it is well written. If there is a new demand, we add some classes to meet new requirements, and the original code will not move.
It is absolutely impossible to disable the modification. No matter how closed the module is, there will be some changes that cannot be closed to it. Since it canno
. 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?(57) If you find multiple inheritance relationships in an object-
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
information in another class (that is, non-communication behavior ).Dependency in a stable direction.(11) make sure that the abstract concept you are modeling for is a class, not just the role played by an object.(12) distribution of system functions in the horizontal 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 crea
a static method, in the same way, we can improve the closure form of the definition:varSingleton = (function(){ varUnique; functiongetinstance () {if(!unique) {Unique=construct (); returnUnique; } } functionconstruct () {varPrivate_member; functionPrivate_method () {}return{//This is the real singleton.Public_member: ", Public_method:function(){} };}) ();This method calls a singleton object:Singleton.getinstance (). Publicmethod ();This will only really create a unique
Copy the codeCode is as follows:
/* PHP Object-Oriented Program Design
*
* PHP5
*
* And an array of objects: all belong to the PHP compound type (a variable can store multiple Unit)
*
* Object than an array of more powerful, not only can store more data, can also be a function of
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.