Learn about grokking object oriented design interview pdf, we have the largest and most updated grokking object oriented design interview pdf information on alibabacloud.com
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
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-
horizontal direction, the system functions should be distributed as much as possible. That is, according to the design, the top-level classes should share work in a unified manner. 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. P30
Plan an interface instead of implementing an interface.
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-
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 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
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.
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-ori
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.
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-ori
(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
When we first came into contact with object-oriented thinking, I think the first concept we came into contact with should be"
Class ", We have been discussing profound issues such as how to design classes and how to implement classes, but have we ever thought about what is called" classes "and what is the essence of classes ?. According to the introduction in mo
change should be closed for the module he designed. He must first guess the most likely types of changes, and then construct an abstraction to isolate those changes.Take action immediately when changes occur.
When we first wrote the code, we assumed that the change would not happen. When a change occurs, we create an abstraction to isolate similar changes that occur later.In the face of requirements, changes to the program are made by adding new Code, rather than changing the existing code.We h
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
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
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 to overwrite the methods in the base class by using an empty
the dynamic semantics of a class by inheriting relationships. Attempting to model dynamic semantics with a static semantic relationship causes the type to be switched 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, step back to see what you are creating. Now, generalize these objects into a class.(52) It
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
, 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
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-
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.