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
[This is my own study notes, welcome reprint, but please specify the source:http://blog.csdn.net/jesson20121020]
Object-oriented (OO) thinking:1. Consider the classNoun2. Consider attributesCan not be separated from the specific application environment3. Method of consideration4. Consider the relationship between classes5. Consider hiding (encapsulation)Reduction of coupling6. Consider inheritanceStron
: type [= default value]
Visibility method Name (parameter list) [: Return value type]
Examples are as follows:(3) The relationship between classes① Association Relationship1) bidirectional correlation. examples are as follows:2) One-way association. Examples are as follows:3) Self-correlating. Examples are as follows:4) Multiple sexual associations. Examples are as follows:5) Aggregation relationship. Examples are as follows:6) combined relationship. Similar to the aggregation relatio
); parent.goSchool(); parent.pay(); parent.getBook(); parent.goHome(); }}? Usually the beginning of the school report is very happy, because after all, just finished years, received a lot of lucky money, but also waiting to go to school flowers quickly. But Xiao Ming too much love, too little money, rather die than report, to Xiao Ming himself to the school report too difficult, Xiao Ming's parents had to replace Xiao Ming to register. Instead of Xiao Ming to enrol
. Low system scalability: Adding a new object needs to add a reference to the original related object, adding a new reference relationship also needs to adjust the original object, the system coupling is very high, the object operation is not flexible, poor extensibility.
4. In the
project, messages of all business modules are sent to the main framework class, then, the main framework class is responsible for forwarding to various display windows, such as views and floating windows, which are managed by the main framework class. To support some specific functions, the system adds a similar message reflection mechanism. If the mouse event of a view sent to a specific module class does not have specific operations or changes, the event will be sent to the view through a mes
in Iofile.However, virtual inheritance is not commonly used because:
1. Virtual inheritance increases the cost of space and time.
2. Virtual inheritance can be very complex (writing costs) because the virtual base class, either indirectly or directly inherited, must assume the initialization of these bases, regardless of how many layers of inheritance are.
Please rememberMultiple inheritance is more complex than single inheritance. It can lead to new ambiguity and the need for
, NB Sp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp nbsp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp , NB Sp
=function () { the // ... - } - This. SetName =function () { - // ... + } - This. Setprice =function () { + // ... A } at //Object Public Properties - This. ID =ID - //Object Public Method - This. Copy =function () { - // ... - } in -}In OOP, there are two concepts: static properties and Static methods, both of which belong to the class, and not each
The merging Reuse Principle is also known as the composition/aggregate Reuse Principle and carp principle. Its definition is as follows:
Composite Reuse Principle (CRP): Use object combinations as much as possible instead of inheritance to achieve reuse.
The merging Reuse Principle is to use some existing objects in a new object through the association relationship (including the combination
S.O.L.I.D is the acronym for several important coding principles (programming Priciple) in object-oriented design and programming (Oodoop).
SRP
the single Responsibility principle
single responsibility principle
OCP
the Open Closed principle
LSP
The Liskov Substitution Princip
S.O.L.I.D is the acronym for several important coding principles (programming Priciple) in object-oriented design and programming (Oodoop).
SRP
the single Responsibility principle
single responsibility principle
OCP
the Open Closed principle
LSP
The Liskov Substitution Princip
: This article mainly introduces (9) The 5 principle of object-oriented design. if you are interested in PHP tutorials, please refer to it. 1. object-oriented summary:
1. high abstraction is conducive to high summarization.
2. the code is a document.
2. example of a message
mechanisms of subproblems.
Ai-Password analysis-large-scale reuse of blackboard architecture instances
Artificial Intelligence generally requires the knowledge base of human beings to approach different AI fields.
Data collection-meteorological monitoring station-small systems will also learn from the object-oriented architecture and reveal some basic principles for the
indexed in the return table return {withdraw = WI Thdraw, deposit = deposit, GetBalance = getbalance}enda1 = NewAccount (0) a2 = newaccount (+) A1.withdraw (+) print ( A1.getbalance ()) print (A2.getbalance ()) a Special "object": This can be used when the object has only a single method. It is a special case of the OOP described earlier, which is not inherited but private and efficient:function NewObj
of programming, which conforms to the normal thinking of people. If we drive a Mercedes Benz is dependent on the Mercedes-Benz, the use of laptops directly rely on notebook computers.② "Dependency inversion": programming is to abstract the real world things, and then we based on the needs of the system design to produce a dependency on the abstract, instead of people's traditional thinking of the dependence between things, called "inverted."3.2 Depen
interface injection;That is, in the function declaration, the argument is an abstract class or interface, which implements the transitive dependent object, thus achieving the purpose of directly using the dependent object.can be summarized as interface passing, construction method passing and Setter method is passed. The core of the dependency inversion principle is that we should interface programming, understand interface-
Objective of the Object-Oriented Design Method
In system design, if the design personnel can achieve the following "six", that is, modular, role-oriented, process-oriented, standardi
: This article mainly introduces (5) Object-Oriented Design Principles 1 --- general principles and single responsibility principles. if you are interested in PHP tutorials, refer to them. I. general principles:
1. five object-oriented principles: single responsibility prin
engine does those things.
First, try traversing the properties in B, but not the Name property.
The request to find the name attribute is delegated to the prototype of the constructor of object B, which is b.__proto__ logged and points to B.prototype, and B. The prototype is set to an object created through new A ().
The name attribute is still not found in the
I have been working for three years. To be honest, I have never studied object-oriented.ProgramDesign, but some emotional understanding in some work plus some so-called theory. Reading a book 《 Head first object-oriented design and analysis " , The story in the book vividly describes OOA D I would like to take this op
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.