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
I recently read the design model. I like this book very much, and the content is also very understandable. I am a little addicted to reading it. Haha, I first looked at the object-oriented basics. I have been familiar with object-oriented basics before, I have a further unde
About the Great software:"Great software is always doing what the customer wants him to do," says the client-friendly program designer . As a result, customers will be able to pay the desired results even when they have a whim to use the software in new ways.The object-oriented programmer says: great software is object-orient
mind anyway)
Good encapsulation, (interface to reasonable, physical design for the fact, do not have much interface, many, good)
The granularity of the class should be reasonable
Consider the correctness of dependencies. (Do not reverse-rely on inverted errors, such as the design of the logical layer and the UI, you are in the logical class of the process relies on the interface of the UI layer an
expresses a specific object (type code) that affects the behavior of the class and may cause the branch statements associated with that type to appear frequently in the program, we should create a new derived class and use polymorphism instead of his
Refinement subclasses: Sometimes, some properties in a class only make sense for some instances of the object, which means that the class's plan is not p
, the constructor pattern is used to define instance properties (each instance itself is unique, not shared), whereas the prototype pattern is used to define methods and shared properties.6.2.5 Dynamic Prototyping ModeAll information is encapsulated in the constructor, and the prototype is initialized in the constructor function.function Person (name, age, Job) { this. Name = name; this. Age = Age ; this. Job = job; if (typeofthis. Sayname! = "Functin") {// in the case that the Sayna
Work needs to do a PHP module, the content of the various sections of the Forum to do statistics, and then data extraction. Each plate has some main topics or content to focus on. For example, the car section, will focus on safety, car maintenance knowledge, how to choose cars and so on. Then the car section of all the posts according to these concerns to classify, calculate points, statistics. Finally, some data are obtained for future data mining.
The problem is: There are many sections on the
I started to learn the design model and posted "design patterns can reuse the basis of object-oriented software" on the Internet. After reading the introduction, I found that I have written so many self-satisfied code before, however, from the perspective of the design model
in the use of object-oriented thinking system design, the predecessors summed up a total of 7 principles, respectively, are:
Single duty principle, open and close principle, Richter replacement principle, Dependency injection principle, interface separation principle, Dimitri principle and priority use combination rather than inheritance principle.
good architecture should be object-oriented and composed of components );Well-managed application iteration and incremental development lifecycle. Pursuing a rational development process, understanding the key aspects of different development processes, and advocating the core concept is the key to understanding different practical processes. Processes are defined as macro and micro processes. Different fr
Document directory
Advantages and disadvantages of Combination
Inheritance
Inheritance/combination Example 1
Inheritance/combination Example 2
Rule 1: Prioritize (object) combinations, rather than (class) Inheritance
[Favor composition over inheritance]
Combination1. (object) combination is a method of reusing new functions by creating an object that comb
, determine the specific subclass when the program runs.
ExtendedThe principle of substitution of the Richter scale is named after Professor Barbara Liskov (Barbara Liskov). Barbara Liskov: American computer scientist, 2008 Turing Award winner, 2004 John Von Neumann Award winner, American Academy of Engineering Academician, American Institute of Arts and Sciences, American Computer Association, MIT professor of Electrical and computer science, an
mechanism to implement the multi-threaded Singleton ModeClass Singleton3
{
Public static readonly Singleton3 Instance = new Singleton3 ();
Private Singleton3 (){}}Class Singleton3_1{Public static readonly Singleton3_1 Instance = new Singleton3_1 ();
Private Singleton3_1 (){}
Static Singleton3_1 (){Instance = new singleton3_1 ();}}
Singleton mode ExtensionExtend an instance to N instances, such as the implementation of the Object pool.Transfers the c
purpose of declaring a non-virtual function is to make derived classes inherit the function interface and a mandatory implementation.
Corresponds to Scenario c.
Pure virtual functions, virtual functions, and non-virtual functions allow you to specify exactly what you want to inherit from derived classes.
Summary:
Interface inheritance and implementation inheritance are different. Under public inheritance, derived classes always inherits the base class interface.
The pure virtual function only s
In the object-oriented design, we have always pursued a kind of result, that is, good reusability. Based on this concept, the object-oriented design includes covariance and contravariance) here are two concepts.
Introduction:
Cov
Object-Oriented Design UML practices:"An analysis model is different from a design model. It does not involve developing any characteristics of the system, but aims to capture some aspects and features of the business in the" real world.Generally, the analysis model describes the data processed in the application and v
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 records of the ideas and application scenario
What is the appearance mode?
By creating a façade interface before the set of required logic and methods, the design pattern hides the complexity from the calling object.
Why Use Design Patterns:
The reason for using an object based on the design pattern is the interface t
Object-oriented:According to what exists in reality, it simulates its characteristics and is used to describe a particular object.1. Using functions to accomplish object-oriented 1 defSchool (NAME,ADDR):#School has a name and address2 defdict_ (name,addr):3dict_={4 'name': Name,5 'Addr': Ad
, dependent class modification on the dependency class is more and more important, the coupling between the two classes is more and more high. The distinction of several relationships should be based on the specific semantic environment, which is simple from the code level: Class A relies on class B to withdraw to a static method that contains a class B object or a class B in a local variable or method parameter in a, and a, B association relationship
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
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.