Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.
Design patterns can speed up the development process by providing tested, proven development paradigms.
Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.
设计模式是约定俗成的最佳实践,程序员可以在设计应用程序或系统时使用它来解决常见问题。
设计模式可以通过提供经过测试和验证的开发范例来加速开发过程。
重用设计模式有助于避免出现导致重大问题的细微问题,并且还可以提高熟悉模式的编码人员和架构师的代码的可读性。
Before you dive into the material, you should be familiar with various Programming/Software Design Principles.
All designs should be as simple as possible. You should start with KISS, YAGNI, and Do The Simplest Thing That Could Possibly Work principles. Complexity and patterns should only be introduced when they are needed for practical extensibility.
Once you are familiar with these concepts you can start drilling down into patterns by any of the following approaches
- Using difficulty tags,
Difficulty-Beginner
,Difficulty-Intermediate
&Difficulty-Expert
. - Using pattern categories,
Creational
,Behavioral
and others. - Search for a specific pattern. Can't find one? Please report a new pattern here.
在深入研究本材料之前,您应该熟悉各种编程/软件设计原则。
所有设计都应尽可能简单。你应该从KISS*(KISS 是英文 Keep it Simple and Stupid 首字母的缩写,意思是“保持简单和愚蠢”,其中“愚蠢”不是“傻”,它还有“迟钝”、“不敏感”、“乏味”、“无价值”等含义;另一种对KISS的解释是 Keep It Simple, Stupid,由于中间加了逗号,意思就变成了“保持简单,傻瓜”,是一种祈使语态,带有调侃的色彩。 [2] 从英文的直译是把事情弄得越简单、越傻瓜化越好。来源:百度百科KISS原则),YAGNI(YAGNI原则指的是只需要将应用程序必需的功能包含进来,而不要试图添加任何其他你认为可能需要的功能。来源:适可而止:You Ain’t Gonna Need It)*开始,做最简单的即能让程序正常工作的事情就好了,只有在实际需要扩展时才应引入复杂的设计或模式。
熟悉这些概念后,您可以通过以下任何方法深入了解模式
- 使用难度标签
Difficulty-Beginner
(初学者),Difficulty-Intermediate(中等模式)
&Difficulty-Expert
(专家模式)。 - 使用模式分类,
Creational
(创造型模式),Behavioral
(行为型模式)和其他。 - 搜索特定模式。找不到一个?请在此处报告新模式。
If you are willing to contribute to the project you will find the relevant information in our developer wiki. We will help you and answer your questions in the Gitter chatroom.
如果您愿意为本项目做出贡献,您可以在我们的developer wiki找到相关信息。我们将在Gitter chatroom帮助您并回答您的问题。
This project is licensed under the terms of the MIT license.
该项目根据MIT许可条款获得许可。