Note: This content was generated by AI. I am working on this page to provide personal content of better quality.

Design patterns

Nota bene : This content was generated by AI. I am working on this page to provide personal content of better quality.

Design patterns are proven solutions to recurring software design problems. They are not copy-paste code: they describe structures and collaborations between classes that you adapt to your context.

Three families

FamilyRole
CreationalFlexible object creation
StructuralClass and object composition
BehavioralResponsibilities and communication

Examples use Python 3. When helpful, the expected console output is shown below the code.

Covered patterns

  • Creational: Abstract Factory, Builder, Factory Method, Prototype, Singleton
  • Structural: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy
  • Behavioral: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor