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. ...

Get Python: Master the Art of Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.