课程: Python: Design Patterns (2021)
What is a design pattern?
- When developing software, you'll often observe the same problem occurring over and over again. These common problems imply that there may already be established solutions. Design patterns are well-known solutions to recurring problems. These are widely accepted solutions by the software development community. Why do we use design patterns instead of individualized solutions? Here are some excellent reasons. First, there is no need to reinvent the wheel and waste your time when there's already a perfect solution for you out there. Second, design patterns allow us to reuse design ideas and encourage us to use the best practices, lowering the cost and promoting the higher quality of the software you're developing. Let's have a brief history lesson on design patterns. The creator of this concept design pattern is Christopher Alexander, a building architect who has little to do with software development. The software development community then picked up the design pattern idea. Gamma and his colleagues also known as the Gang of Four, immortalized it in their famous book called Design Patterns. Here are some essential characteristics of design patterns, you should know. First, design patterns are language neutral. You could use them in any object oriented programming language. Second, design patterns are dynamic because there're always new ones coming up. You could also be revising the existing design patterns if there is a need. Finally design patterns are intentionally incomplete to promote customization. These days, professional software developers must master design patterns because these patterns are becoming a core vocabulary when discussing design decisions for a software application among seasoned software developers.