Introduction to Java EE design patterns

Source: Internet
Author: User

1. What is design mode

Design patterns provide a solution to common application design problems. In object-oriented programming, design patterns typically address issues related to object creation and interaction, rather than the large-scale problems faced by the overall software architecture, which provide a common solution in the form of boilerplate code that can be applied to real-world problems. Typical class diagrams are shown in 1-1.

Figure 1-1 shows the class diagram of the inheritance relationship

2. Why design patterns are required

It provides developers around the world with proven and tested solutions for the most common software engineering challenges.

3. Initial classification of design patterns

(1) creation mode --the mode controls the creation, initialization, and selection of the class. The Singleton and the factory belong to this category.

(2) behavioral mode --the mode controls the communication between objects, message passing and interaction. Observers belong to this category.

(3) structured mode --patterns are used to organize relationships between objects, to group related objects together and to use them to provide guidance for the desired behavior. Decorative patterns belong to this category.

4. Mode usage Precautions

Design patterns represent collective wisdom, but it does not mean that we need to use them all the time. According to the actual situation and the problem needs to use, the mode will play the maximum performance.

--javaee Design Pattern series is mainly to the "Java EE design mode analysis and application" collation and summary

Introduction to Java EE 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.