Discover design patterns reusable object oriented, include the articles, news, trends, analysis and practical advice about design patterns reusable object oriented on alibabacloud.com
. Use aggregations/combinations to achieve code reuse and less inheritance reuse.Dependency Inversion principle: For abstract programming, do not target specific programming.Seven design principles of object-oriented1. Opening and closing principle2, the Richter replacement principle3. Single Duty principle4. Interface Isolation principle5. Dependency Inversion principle6. Dimitri Principle7. Combination/Ag
GoF(四人帮)那本《设计模式 可复用面向对象软件的基础》可谓是设计模式方面的经典之作,其中介绍的23种设计模式,也可谓是经典中的经典。但是,设计模式的种类绝不仅仅是这23种,除此之外还有很多巧妙可爱的设计模式值得我们学习。这些被遗忘的设计模式,也可以堪称经典之作。今天我们来一起学习被遗忘的设计模式——空对象模式(Null Object Pattern)。一起看看这个模式会带给我们怎样的惊喜?First, Pattern name
Provide an object as a surrogate for the lack of an object of a given type. The Null Object p
Ask PHP design for object-oriented design and data accessibility
For example, there is a class person
There is a database operation class Conn
One of the actions in person is to buy a chicken, the chicken information to be put into the database
How should I design it?
is to
a good software design is to try to change
If your software is hard to change, the problem may occur when you want to improve the design. Now let's see if several instruments can be easily changed. If a new instrument is added to an existing program, we need to add a new instrument specification and add a new query method to inventory, which does not seem easy to change!
It seems that we still ha
java design mode (1)A simple introduction to the design pattern: is a solution to the problem of an effective idea, to solve specific circumstances, recurring problems of the solution.So why do we need to learn design patterns?1, the design mode are some of the relatively ex
GRASP OverviewGRASP, General Responsibility assignment software Patterns, translated as "Common responsibility allocation software principles", including the following principles and patternsControllers (Controller)The controller mode is used to receive and handle system events, and should generally be assigned to a system that represents the whole or a single use case scenario
A use case controller should be used to handle all system events
constructor, and by initializing the prototype in the constructor (only if necessary), while preserving the advantages of using both constructors and prototypes. In other words, you can determine whether a prototype needs to be initialized by checking that a method that should exist is valid.Parasitic constructor modeIf the above methods are not applicable, parasitic patterns can be applied. The core idea of this pattern is to create a function that
main program body code of the main package requires a long Compilation Time, or the SCP and notice packages are provided in the form of a shared library or DLL, the preceding modifications are necessary. Otherwise, if the program size is small and the compilation time required by the main code of the program can be ignored, the modifications are not required. After all, the modified program structure adds an abstract layer, which increases complexity.
database design, the mapping of the system object model to the database schema is the key of object-oriented database design.
1. Three-tier database schema extension of object-oriented
, during their development, UML it is a mainstream modeling language, the model has gradually become a hot research topic. However, most books on design patterns mostly describe and record the design patterns, but seldom talk about how to systematically apply these reusable
Ask for PHP object-oriented design and data access design. for example, if one class Person has a database operation class ConnPerson, one operation is to buy a chicken, how should we design chicken information in the database? Whether to include the Conn class in perison, i
Ask for PHP object-oriented design and data access design. for example, if one class Person has a database operation class ConnPerson, one operation is to buy a chicken, how should we design chicken information in the database? Whether to include the Conn class in perison, i
attribute Name: type [= default value]
Visibility method Name (parameter list) [: Return value type]
Examples are as follows: (3) The relationship between classes ① Association Relationship 1) 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. Simi
tree-like Java object to a database, and vice versa. The core of this work is how to accomplish this work with minimal performance loss.
The EJB framework provides such an object persistence mechanism. We will discuss this mechanism in this article, but first of all we have a comprehensive understanding of the EJB architecture.
Enterprise-Class JavaBeans (EJB)
EJB technology can be defined as this: it is a
used to trust the customer's request and isolate the direct dependency between the customer and the interface? System overhead. 2. Multi-inheritance separation: it is better to implement Customer requirements through multi-inheritance through interfaces.
The above five are the main object-oriented design principles. They are like the Golden laws in
In the previous article, we initially learned about the OO design. The most unique feature of the OO design is the way he views the needs. In this way, we do not need to rush to determine which processes the software needs to implement, which functional points should be designed, and which pictures should be made. Instead, we need to focus on some more basic concepts in the requirements. First, develop some
30-minute understanding of Object-Oriented Design Principles
Many people have read the design patterns, but Martin does not have much estimation on the object-oriented
it is not possible to be completely closed, the designer must make a choice about what kind of change the module he designed should be closed. He had to guess the type of change most likely to occur, and then construct abstractions to isolate those changes.Wait until the change takes place and take action immediately.
When we first write the code, we assume that the change does not occur. When changes occur, we create abstractions to isolate the same kind of changes that occur later.In the fac
delegate the customer's request, isolate the direct dependency between the customer and the interface, but it will increase the system overhead. 2. Multi-inheritance separation: it is better to implement Customer requirements through multi-inheritance through interfaces.
The above five basic object-oriented design principles are like the Golden laws in
the very beginning, I paid special attention to the knowledge of software design. The three books I have read here happen to reflect several aspects of software design and development:
Programming and Development: Design Patterns elements of reusable
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.