Java Design Patterns

Source: Internet
Author: User

Create a pattern

The creation pattern, which is the pattern of creating objects, abstracts the process of instantiation.
It helps a system to be independent of those objects that create, group, and represent it.
The focus is on the creation of objects, the creation of patterns that abstract the process of creating objects, or the encapsulation of the process of creating objects, as a client program that only needs to use objects, and no longer cares about the logic in the process of creating objects

Structural mode

The structure pattern is to solve how to assemble the existing classes, design their interaction mode, so as to achieve a certain function.
The structural model embraces the solution to many problems. For example: extensibility (appearance, composition, agent, decoration) encapsulation (adapter, bridging).

Behavioral patterns

Behavioral patterns involve the allocation of duties between algorithms and objects.
Behavior patterns describe the patterns of objects and classes, and the modes of communication between them.
The behavioral pattern is a kind of complex control flow which is difficult to track when the program is running, which can be divided into behavior class pattern and behavior object pattern.

    1. The behavior pattern uses the inheritance mechanism to dispatch behavior between classes.
    2. The Behavior object pattern uses object aggregation to assign behavior.

Some behavioral object patterns describe how a set of peer objects work together to accomplish a task that neither of these objects can accomplish alone.

One, create model (creational Patterns)
This type of design pattern is the expression of the object's creation process and the relationship between the objects used by the user.
Two, the structural model (Structural Patterns)
This type of pattern concerns how classes and objects are organized together to form large structures. Use inheritance primarily to organize interfaces or implementations.
Three, behavioral patterns (behavioral Patterns)
This type of pattern is concerned with the algorithm and the assignment of tasks between objects. It describes not just the design patterns of objects or classes, but also the communication patterns between them.

Java Design Patterns

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.