- Django Design Patterns and Best Practices
- Arun Ravindran
- 246字
- 2021-06-25 21:32:00
Gang of four patterns
One of the earliest efforts to study and document design patterns was a book titled Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, who later became known as the Gang of Four (GoF). This book is so influential that many consider the 23 design patterns in the book as fundamental to software engineering itself.
In reality, the patterns were written primarily for static object-oriented programming languages, and it had code examples in C++ and Smalltalk. As we will see shortly, some of these patterns might not even be required in other programming languages with better higher-order abstractions such as Python.
The 23 patterns have been broadly classified by their type as follows:
- Creational patterns: These include abstract factory, builder pattern, factory method, prototype pattern, and singleton pattern
- Structural patterns: These include adapter pattern, bridge pattern, composite pattern, decorator pattern, facade pattern, flyweight pattern, and proxy pattern
- Behavioral patterns: These include chain-of-responsibility, command pattern, interpreter pattern, iterator pattern, mediator pattern, memento pattern, observer pattern, state pattern, strategy pattern, template pattern, and visitor pattern
While a detailed explanation of each pattern would be beyond the scope of this book, it would be interesting to identify some of these patterns present in Django implementation itself:

While these patterns are mostly of interest to those studying the internals of Django, the most commonly question asked is, under which pattern is Django itself classified?
- 黑客攻防從入門到精通(實戰(zhàn)秘笈版)
- LabVIEW程序設計基礎與應用
- Mastering RabbitMQ
- Python零基礎快樂學習之旅(K12實戰(zhàn)訓練)
- VMware vSphere 6.7虛擬化架構實戰(zhàn)指南
- 微信公眾平臺開發(fā):從零基礎到ThinkPHP5高性能框架實踐
- TypeScript項目開發(fā)實戰(zhàn)
- Cocos2d-x學習筆記:完全掌握Lua API與游戲項目開發(fā) (未來書庫)
- Getting Started with Greenplum for Big Data Analytics
- 新一代SDN:VMware NSX 網絡原理與實踐
- Swift 4從零到精通iOS開發(fā)
- Android開發(fā)三劍客:UML、模式與測試
- 區(qū)塊鏈架構之美:從比特幣、以太坊、超級賬本看區(qū)塊鏈架構設計
- Visual C++程序設計與項目實踐
- 微前端設計與實現(xiàn)