- Learning Python Design Patterns(Second Edition)
- Chetan Giridhar
- 223字
- 2021-07-16 09:46:15
Classifying patterns
The book by GoF on design patterns spoke about 23 design patterns and classified them under three main categories:
- Creational patterns
- Structural patterns
- Behavioral patterns
The classification of patterns is done based primarily on how the objects get created, how classes and objects are structured in a software application, and also covers the way objects interact among themselves. Let's talk about each of the categories in detail in this section.
Creational patterns:
The following are the properties of Creational patterns:
- They work on the basis of how objects can be created
- They isolate the details of object creation
- Code is independent of the type of object to be created
An example of a creational pattern is the Singleton pattern.
Structural patterns
The following are the properties of Structural patterns:
- They design the structure of objects and classes so that they can compose to achieve larger results
- The focus is on simplifying the structure and identifying the relationship between classes and objects
- They focus on class inheritance and composition
An example of a behavior pattern is the Adapter pattern.
Behavioral patterns
The following are the properties of Behavioral patterns:
- They are concerned with the interaction among objects and responsibility of objects
- Objects should be able to interact and still be loosely coupled
An example of a behavioral pattern is the Observer pattern.
推薦閱讀
- 大學計算機基礎實驗教程
- Java技術手冊(原書第7版)
- VSTO開發入門教程
- 自然語言處理Python進階
- Learning SciPy for Numerical and Scientific Computing(Second Edition)
- Java高并發核心編程(卷1):NIO、Netty、Redis、ZooKeeper
- Learning Docker Networking
- Python 3.7從入門到精通(視頻教學版)
- Java圖像處理:基于OpenCV與JVM
- 從Power BI到Analysis Services:企業級數據分析實戰
- NGUI for Unity
- 3D Printing Designs:Octopus Pencil Holder
- JavaScript程序設計實例教程(第2版)
- Python Geospatial Analysis Cookbook
- jMonkeyEngine 3.0 Cookbook