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