Skip to content

Design Patterns Catalog

A Design Patterns Catalog serves as a structured repository of software design patterns, providing standardized solutions to common problems in software architecture^[600-developer__23种设计模式.md]。

These patterns are best practices that a programmer can use to solve common problems when designing an application or system^[600-developer__23种设计模式.md]。

Purpose and Benefits

Design patterns act as blueprints for solving recurring design issues. They are not code that can be directly plugged into a program, but rather templates or descriptions that describe how to solve a problem, which can then be used in many different situations^[600-developer__23种设计模式.md]。

The primary benefits of using a design patterns catalog include^[600-developer__23种设计模式.md]:

  • Reusability: Patterns help improve code reusability by applying tested and proven development paradigms.
  • Comprehensibility: They make code easier to understand for developers familiar with the patterns, as the structure and relationships are well-documented.
  • Reliability: Using established patterns increases code reliability, as the solutions have been used and refined over time in various contexts.

Classification

The most widely referenced catalog is the collection of 23 classic design patterns, originally documented by the "Gang of Four"^[600-developer__23种设计模式.md]。

These patterns are generally categorized into three types based on their purpose^[600-developer__23种设计模式.md]:

1. Creational Patterns (創建型)

These patterns deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. There are 5 patterns in this category^[600-developer__23种设计模式.md]。

2. Structural Patterns (結構型)

These patterns explain how to assemble objects and classes into larger structures while keeping these structures flexible and efficient. There are 7 patterns in this category^[600-developer__23种设计模式.md]。

3. Behavioral Patterns (行为型)

These patterns are concerned with algorithms and the assignment of responsibilities between objects. They focus on communication between objects. There are 11 patterns in this category^[600-developer__23种设计模式.md]。

Usage

When learning or applying design patterns, it is often recommended to use efficient learning strategies, such as the 20/80 Learning Principle. This involves focusing on the core patterns that deliver the most value in real-world scenarios rather than attempting to memorize every detail of the entire catalog at once^[600-developer__23种设计模式.md]。

  • [[23种经典设计模式]]
  • [[Software Architecture]]
  • [[Object-Oriented Programming]]

Sources

  • 600-developer__23种设计模式.md