官术网_书友最值得收藏!

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?

主站蜘蛛池模板: 宁河县| 长宁县| 望奎县| 南涧| 三明市| 喀什市| 奉新县| 自治县| 河北省| 张家川| 海兴县| 镇巴县| 洛浦县| 彩票| 乌拉特前旗| 商丘市| 册亨县| 大关县| 岳池县| 北辰区| 嘉峪关市| 长寿区| 普兰店市| 曲周县| 铜川市| 常德市| 名山县| 东乡县| 和硕县| 始兴县| 宣威市| 北流市| 平定县| 德昌县| 莫力| 凤凰县| 九台市| 桃源县| 安塞县| 清河县| 闽清县|