liveBook · Manning

Design pattern

As explained in Software Design for Python Programmers

A design pattern is an industry-proven model for creating a solution to a recurring software design problem.

A design pattern is an industry-proven model for creating a custom solution to a recurring software architecture problem. It is a model, not a ready-made solution: adapt it to the application’s requirements. section 1.1 section 8.0

Use design patterns to:

Publisher–subscriber architecture

A publisher produces data while subscribers consume it. The Observer Design Pattern supplies a model for separating these roles into a custom solution. Similar pattern-based evolution appears when interchangeable sports strategies are selected at runtime. section 1.4.5 section 8.0

Apply a pattern after understanding requirements, then compare a straightforward implementation with a refactored design. Good design balances flexibility against added complexity rather than anticipating every possible change. section 1.2 section 1.7

How Software Design for Python Programmers covers it

How deep it goes
Defines patterns and demonstrates their application through before-and-after examples, but stops short of treating any pattern as directly reusable code.
Examples
Uses publisher–subscriber components, sports reports, and interchangeable sports recruitment and venue strategies as examples.
What it assumes
Assumes basic data structures, algorithms, object-oriented programming, and practical programming skills while building design knowledge through examples.
What you can do after
Apply it through before-and-after examples to design flexible solutions and assess whether architectures use appropriate industry-standard patterns.
How it connects
Connects design patterns with design principles, software architecture, object-oriented programming, Observer, Template Method, and Strategy.

Also explained in

Compare how 7 books explain design pattern →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Software Design for Python Programmers. The section links point to the parts of the book it draws on.