A good website that learns Design Patterns

Source: Internet
Author: User

Http://www.riabook.cn/doc/designpattern/

From gossip @ caterpillar: Design Mode

Program Design is a concrete way of thinking. It is a process of thinking about how to solve the problem. The design model is integrated with experience of some good ideas in the process of solving the problem, at first, we talked about the design pattern and people always mentioned gof.
It first brings together the 23 classic models to illustrate the future of learning programming, especially for people engaged in object-oriented programming.

Later, the term "design patterns" was widely used for experience integration, and even antipattern, which taught you how to avoid some common and plausible programming thinking.

Here we will sort out some learning experiences on the design mode. The implementation part is using Java, so you will see some images and implementation methods different from the gof mode, this is to make good use of some java features. As for the implementation of C ++, The gof book has provided many examples.

In practice, you will find that I have replaced abstract class with interfaces, which is different from the examples in the previous gof book, this is because there is no interface in C ++ and an abstract category that does not implement any method at all. Based on the theme features described at the time, it will be converted into an interface if possible, semantics is more in line with the features of the Java language, but you need to know that the abstract categories of interfaces and completely non-practical methods are interchangeable in some cases.

The UML diagrams shown here are all drawn using Jude. Jude is a UML tool program written in pure Java and can be run
Windows, Linux and other platforms, small size, easy to use.

Gof Mode

The following design patterns are my personal experiences and practices from gof, and several simple import or derivative modes are added.

    • Creational Model
The generation of objects consumes system resources, so how to efficiently produce, manage, and operate objects has always been a topic worth discussing. The creational model is related to the establishment of objects, the pattern under this classification provides some guiding principles and design directions.
      • Simple factory Mode
      • Abstract Factory Mode
      • Builder Mode
      • Factory method mode
      • Prototype Mode
      • Singleton Mode
      • Registry of Singleton Mode

    • Structural Mode
How to Design static structures between objects, and how to complete inheritance, implementation, and dependency between objects is related to whether the system design is robust (robust ): such as easy to understand, easy to maintain, easy to modify, low coupling, and so on. The structural mode, just like its name, provides the relational structures of various objects applicable to different occasions.
      • Default adapter Mode
      • Adapter mode-Object Adapter
      • Adapter mode-class Adapter
      • Bridge Mode
      • Composite Mode
      • Decorator Mode
      • Facade Mode
      • Flyweight Mode
      • Proxy mode (1)
      • Proxy mode (2)

    • Behavioral mode
Cooperation between objects constitutes the final behavior of the program. If there is a well-designed interaction between objects, it not only makes the program more efficient during execution, it makes the responsibilities of objects clearer and the dynamic structure of the entire program (such as object scheduling) more flexible.
      • Chain of responsibility Mode
      • Command mode
      • Interpreter Mode
      • Iterator Mode
      • Mediator Mode
      • Memento Mode
      • Observer Mode
      • State Mode
      • Strategy Mode
      • Template Method Mode
      • Visitor Mode

Multi-thread mode

Multiple execution threads are used in many applications, especially in Web applications. The multi-execution threads are based on the gof sorting mode, how to combine these basic modes to meet the security requirements of multiple execution threads.

    • Guarded suspension mode
    • Producer consumer Mode
    • Worker thread mode
    • Thread-per-message mode
    • Future Mode
    • Read-write-lock mode
    • Two-phase termination Mode
    • Thread-specific storage mode
References

The following is an introduction Website Based on Java design patterns. You can find more resources based on the following links.

    • Huston Design Pattern
    • The design patterns Java companion
    • Learning from Banqiao's Java Design Model
    • UML software engineering organization

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.