
Lecture 01 — Course Introduction
Section: 1 · Duration: 3–4 min · Type: Video
Objective
Frame the course, the audience, and the seven-section path from theory to production. Ship the mandatory AI-authorship disclaimer at the open so every student understands how the material was built and curated.
Core concepts
What you will build by the end of the course
Who the course is for and what you should already know
The seven-section arc from introduction to production
AI-authorship disclaimer and how the course references work
Lecture 02 — How My Udemy Courses Work
Section: 1 · Duration: 3–4 min · Type: Video
Objective
Explain the lecture, lab, and quiz structure, introduce the companion GitHub repository, and tell the student how to follow along with code on a second screen.
Core concepts
The four-part lecture rhythm: watch → read article → run lab → take quiz
Companion repository layout: one folder per pattern with bad-example, good-example, and test files
How to clone the repo and verify Python 3.12+ before starting Section 2
How to use the course Q&A for stuck moments and pattern debates
Lecture 03 — What Are Design Patterns?
Section: 1 · Duration: 5–6 min · Type: Video
Objective
Define design patterns, their origin with the Gang of Four, and how to tell when a pattern helps versus when it becomes ceremonial over-engineering.
Core concepts
The 1994 GoF book and why its 23 patterns became the shared vocabulary
Pattern = named solution to a recurring design problem, not a reusable library
What a pattern is NOT: an algorithm, a framework, a copy-paste template
The “when it helps” test: does the pattern name make a future reader faster?
Lecture 04 — Categories of Design Patterns
Section: 1 · Duration: 4–5 min · Type: Video
Objective
Introduce the three GoF categories — creational, structural, and behavioral — and explain how each category maps to a different kind of design problem.
Core concepts
Creational — decouples how objects are created from where they are used (Factory, Abstract Factory, Prototype, Builder, Singleton)
Structural — composes objects to form larger structures without coupling them to concrete implementations (Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy)
Behavioral — distributes responsibility between objects and defines how they interact (Command, Strategy, State, Observer, Template Method, Iterator, Chain of Responsibility, Interpreter, Mediator, Memento, Visitor)
Why the categories overlap in practice — real code frequently combines patterns from different categories
Lecture 05 — Why Python?
Section: 1 · Duration: 4–5 min · Type: Video
Objective
Explain why Python is a particularly good language to learn design patterns in: duck typing, first-class functions, decorators, and dataclasses collapse a lot of the boilerplate that clutters the classic Java and C++ examples.
Core concepts
Duck typing — many structural patterns (Adapter, Bridge, Proxy) become near-trivial
First-class functions — Strategy and Command lose most of their ceremony
Decorators — the Decorator pattern and the @decorator syntax are different-but-related things; we will cover both
dataclass, __post_init__, and the protocol-typing ecosystem
Where Python's dynamism hides pattern intent — and when to document it anyway
Objective
Step-by-step installation of Python 3.12 or newer, VS Code, and the extensions the rest of the course depends on. The student finishes this lecture with a working editor and a terminal that responds to python --version.
Core concepts
Download and install Python 3.12+ (Windows/macOS/Linux paths)
Verify installation in a terminal: python --version and pip --version
Install VS Code and pin the Python, Pylance, and Python Debugger extensions
Optional but recommended: uv as a faster dependency manager (pip install uv)
Platform pitfalls: Windows py launcher, macOS python3 alias, Linux python-is-python3
Lecture 07 — Setting Up the Standard Environment
Section: 1 · Duration: 4–5 min · Type: Video
Objective
Clone the companion repository, create the project virtual environment, install the course dependencies, and run the validation script so the student knows the toolchain is ready before Section 2.
Core concepts
Clone Cataldir/design-patterns-python to a known location
Create a virtual environment with python -m venv .venv (or uv venv)
Activate the venv on Windows (.venv\Scripts\Activate.ps1) and Unix (source .venv/bin/activate)
Install dependencies with pip install -r requirements.txt (or uv pip install -r requirements.txt)
Run pytest -q against the reference tests to confirm the environment is green
Configure VS Code to use the venv interpreter (Python: Select Interpreter)
Lecture 08 — Why Use Design Patterns?
Section: 2 · Duration: 5–6 min · Type: Video
Objective
Motivate patterns through real refactoring stories — the cost of missing patterns, the benefit of the shared vocabulary. This is the preview lecture visible to prospective students.
Core concepts
The real cost of missing patterns: brittle code, slow onboarding, untestable logic
Refactoring story: a 2000-line order handler split into Strategy + Command
The shared-vocabulary payoff: code reviews become faster, design discussions become cheaper
When NOT to reach for a pattern: YAGNI still applies
Lecture 09 — Business Modeling Fundamentals
Section: 2 · Duration: 6–7 min · Type: Video
Objective
Introduce process modeling and show why code patterns emerge from business patterns. The insight is that a well-modeled business process practically tells you which GoF pattern to reach for.
Core concepts
Process modeling as the prerequisite to pattern selection
Nouns become classes, verbs become methods, decision points become strategies
A simple order-fulfillment process: receive, validate, price, fulfill, notify
How each step maps to a candidate pattern
Lecture 10 — Business Process Modeling Notation
Section: 2 · Duration: 6–7 min · Type: Video
Objective
BPMN quick primer — enough notation to read and produce process diagrams that drive pattern choice.
Core concepts
BPMN 2.0 core elements: events, tasks, gateways, sequence flows
Start event, end event, and intermediate events
Exclusive gateway (XOR) for if-else, parallel gateway (AND) for concurrent work
Reading a BPMN diagram: left to right, top to bottom
Drawing a simple order process in BPMN before choosing patterns
Lecture 11 — Mapping Patterns with AI
Section: 2 · Duration: 7–8 min · Type: Video
Objective
Use an LLM to propose design patterns for a described process; validate, reject, and refine the AI suggestions with engineering judgment.
Core concepts
Prompt structure: describe the process, ask for candidate patterns, request trade-offs
Evaluating AI suggestions: does the pattern name make future readers faster?
Common AI over-suggestions: Abstract Factory for single families, Mediator for simple flows
The human role: accept, reject, or refine — never copy blindly
Lecture 12 — Creational Patterns
Section: 3 · Duration: 4–5 min · Type: Video
Objective
Roadmap of the five creational patterns covered in Section 4, with a one-liner for each so students know what is coming.
Core concepts
Factory Method — delegate object creation to subclasses so the caller does not depend on concrete types
Abstract Factory — produce families of related objects without specifying their concrete classes
Prototype — create new objects by cloning an existing instance
Builder — construct complex objects step by step, separating construction from representation
Singleton — ensure a class has one instance (mentioned for completeness; we skip the dedicated lecture because Python modules are natural singletons)
Lecture 13 — Structural Patterns
Section: 3 · Duration: 4–5 min · Type: Video
Objective
Roadmap of the six structural patterns covered in Section 5, with a one-liner for each.
Core concepts
Adapter — make incompatible interfaces work together without changing either side
Bridge — separate an abstraction from its implementation so both can vary independently
Flyweight — share intrinsic state across many objects to reduce memory use
Proxy — provide a surrogate that controls access to another object
Facade — offer a simplified interface to a complex subsystem
Composite — compose objects into tree structures (mentioned for completeness; revisited briefly inside Facade)
Lecture 14 — Behavioral Patterns
Section: 3 · Duration: 4–5 min · Type: Video
Objective
Roadmap of the seven behavioral patterns covered in Section 6, with a one-liner for each.
Core concepts
Command — encapsulate a request as an object so it can be queued, logged, or undone
Strategy — define a family of algorithms and make them interchangeable at runtime
State — let an object change its behavior when its internal state changes
Observer — notify dependent objects automatically when a subject changes
Template Method — define the skeleton of an algorithm, letting subclasses override specific steps
Iterator — access elements of a collection sequentially without exposing its representation
Chain of Responsibility — pass a request along a chain of handlers (mentioned for completeness; revisited inside Command)
Lecture 15 — Algorithms and Principles
Section: 3 · Duration: 5–6 min · Type: Video
Objective
SOLID principles, composition over inheritance, and the algorithmic ideas (dispatch, state machines, hooks) that underlie the patterns in sections 4 through 6.
Core concepts
SOLID: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion
Composition over inheritance: prefer “has-a” relationships that are swappable at runtime
Dispatch: choosing behavior based on type or key — the mechanism behind Strategy and Command
State machines: finite states with defined transitions — the mechanism behind State
Template hooks: fixed skeleton with overridable steps — the mechanism behind Template Method
Lecture 16 — Reviewing the Creational Patterns
Section: 4 · Duration: 3–4 min · Type: Video
Objective
Entry lecture for the creational section: the problem creational patterns solve is decoupling object creation from usage so the calling code does not depend on concrete classes.
Core concepts
The creational problem: hard-coded constructors couple callers to concrete types
All creational patterns answer one question: who creates the object and how?
Four patterns in this section: Factory, Abstract Factory, Prototype, Builder
Singleton is omitted as a dedicated lecture because Python modules are natural singletons
Lecture 17 — Factory
Section: 4 · Duration: 4–5 min · Type: Video
Objective
Factory Method pattern — when and how to use it in Python, with a worked refactor from hard-coded constructors to a factory function.
Core concepts
Problem: calling code coupled to concrete class names
Solution: a factory function or method that maps a key to a class
Python idiom: dictionary dispatch instead of if-else chains
Lecture 18 — Abstract Factory
Section: 4 · Duration: 4–5 min · Type: Video
Objective
Abstract Factory — the family-of-products pattern. Contrast with Factory Method and show when the extra abstraction is justified.
Core concepts
Problem: creating families of related objects that must stay consistent
Solution: a factory interface that produces the entire family
Python idiom: a factory class per family, with a top-level selector
Lecture 19 — Prototype
Section: 4 · Duration: 3–4 min · Type: Video
Objective
Prototype pattern — create new objects by cloning an existing instance. Show Python’s copy module and dataclass-based cloning.
Core concepts
Problem: creating objects is expensive or complex, but most instances differ by only a few fields
Solution: clone a prototype and tweak the differences
Python idiom: copy.copy / copy.deepcopy or dataclasses.replace
Lecture 20 — Builder
Section: 4 · Duration: 4–5 min · Type: Video
Objective
Builder pattern — construct complex objects step by step, separating construction logic from representation.
Core concepts
Problem: constructors with many optional parameters are hard to read and easy to misuse
Solution: a builder that exposes named steps and produces the final object on .build()
Python idiom: fluent builder or @dataclass(frozen=True) with keyword-only args
Section: 5 · Duration: 3–4 min · Type: Video
Objective
Entry lecture for the structural section: the problem structural patterns solve is assembling objects and classes into larger structures while keeping those structures flexible and efficient.
Core concepts
The structural problem: combining objects without creating rigid hierarchies
Two flavors: class-based (inheritance) and object-based (composition)
Five patterns in this section: Adapter, Bridge, Flyweight, Proxy, Facade
Composite is mentioned briefly inside Facade; Decorator is skipped because Python has native decorators
Lecture 22 — Adapter
Section: 5 · Duration: 4–5 min · Type: Video
Objective
Adapter pattern — make an incompatible interface work with existing code without changing either side.
Core concepts
Problem: third-party or legacy code exposes an interface that does not match what your system expects
Solution: a wrapper that translates calls from the expected interface to the actual one
Python idiom: Protocol-based adapter — no inheritance required
Lecture 23 — Bridge
Section: 5 · Duration: 4–5 min · Type: Video
Objective
Bridge pattern — separate an abstraction from its implementation so both can vary independently.
Core concepts
Problem: two orthogonal dimensions of variation causing a Cartesian explosion of subclasses
Solution: compose the abstraction with the implementation via a reference
Python idiom: inject the implementation via the constructor
Lecture 24 — Flyweight
Section: 5 · Duration: 3–4 min · Type: Video
Objective
Flyweight pattern — share intrinsic state across many objects to reduce memory consumption.
Core concepts
Problem: thousands of objects with large amounts of shared state consume too much memory
Solution: extract the shared (intrinsic) state into a flyweight object and reference it
Python idiom: a factory dict that caches and reuses flyweight instances
Lecture 25 — Proxy
Section: 5 · Duration: 4–5 min · Type: Video
Objective
Proxy pattern — provide a surrogate that controls access to another object for caching, lazy loading, or access control.
Core concepts
Problem: you need to add cross-cutting behavior (caching, auth, lazy init) without changing the real object
Solution: a proxy class that implements the same interface and wraps the real object
Proxy types: virtual (lazy), caching, protection, logging
Lecture 26 — Facade
Section: 5 · Duration: 3–4 min · Type: Video
Objective
Facade pattern — provide a simplified interface to a complex subsystem.
Core concepts
Problem: callers must interact with many subsystem classes to accomplish a single task
Solution: a facade class that orchestrates the subsystem behind a simple API
Python idiom: a module-level function or class that imports and coordinates internal modules
Lecture 27 — Reviewing the Behavioral Patterns
Section: 6 · Duration: 3–4 min · Type: Video
Objective
Entry lecture for the behavioral section: the problem behavioral patterns solve is distributing responsibilities and communication between objects.
Core concepts
The behavioral problem: how objects collaborate and delegate work at runtime
Two themes: algorithms that vary (Strategy, Template Method) and event-driven coordination (Observer, Command)
Six patterns in this section: Command, Strategy, State, Observer, Template Method, Iterator
Chain of Responsibility is mentioned inside Command; Memento is briefly referenced inside State
Lecture 28 — Command
Section: 6 · Duration: 4–5 min · Type: Video
Objective
Command pattern — encapsulate a request as an object so it can be queued, logged, or undone.
Core concepts
Problem: you need to parameterize operations, queue them, or support undo
Solution: encapsulate each operation as a command object with execute and optionally undo
Python idiom: callable classes or dataclasses with execute/undo methods
Lecture 29 — Strategy
Section: 6 · Duration: 4–5 min · Type: Video
Objective
Strategy pattern — define a family of algorithms and make them interchangeable at runtime.
Core concepts
Problem: multiple algorithms for the same task, selected at runtime
Solution: encapsulate each algorithm behind a common interface and inject the chosen one
Python idiom: first-class functions as strategies, or Protocol for complex strategies
Lecture 30 — State
Section: 6 · Duration: 4–5 min · Type: Video
Objective
State pattern — let an object change its behavior when its internal state changes, appearing to change its class.
Core concepts
Problem: an object's behavior depends on its state, with complex transition rules
Solution: represent each state as a class; the context delegates to the current state object
Python idiom: state classes with a common Protocol, transitions return the next state
Lecture 31 — Observer
Section: 6 · Duration: 4–5 min · Type: Video
Objective
Observer pattern — notify dependent objects automatically when a subject changes, without tight coupling.
Core concepts
Problem: multiple components need to react when something changes, but you do not want them coupled to the source
Solution: subject maintains a list of observers and notifies them on change
Python idiom: callback lists, or a lightweight event emitter class
Lecture 32 — Template Method
Section: 6 · Duration: 3–4 min · Type: Video
Objective
Template Method — define the skeleton of an algorithm in a base class, letting subclasses override specific steps.
Core concepts
Problem: several classes share the same algorithmic structure but differ in specific steps
Solution: base class defines the skeleton; subclasses override hook methods
Python idiom: abc.ABC with @abstractmethod for mandatory hooks
Lecture 33 — Iterator
Section: 6 · Duration: 3–4 min · Type: Video
Objective
Iterator pattern — access elements of a collection sequentially without exposing its underlying representation.
Core concepts
Problem: callers need to traverse a collection without knowing if it is a list, tree, database cursor, or network stream
Solution: the collection exposes an iterator that yields elements one at a time
Python idiom: __iter__ / __next__ or generator functions with yield
Lecture 34 — Validation and Testing with AI
Section: 7 · Duration: 5–6 min · Type: Video
Objective
Use LLMs and linters to validate pattern implementations: generate tests, detect anti-patterns, and review refactors.
Core concepts
AI-assisted test generation: prompt an LLM with the pattern class and ask for pytest cases covering the contract
Anti-pattern detection: ask the LLM to critique a codebase for pattern misuse (e.g., Singleton abuse, God Factory)
Refactor review: before and after code diffs reviewed by an LLM for correctness and pattern conformance
Static analysis: mypy and pylint catch structural violations that narration cannot
Human gate: LLM suggestions are proposals, not final decisions — review before merging
Lecture 35 — From Prototype to Production
Section: 7 · Duration: 5–6 min · Type: Video
Objective
Bridge the gap between a clean pattern demo and a production codebase: packaging, dependency injection, configuration, and observability.
Core concepts
Packaging: organize patterns into modules with clear public APIs (__init__.py exports)
Dependency injection: wire concrete strategies, factories, and observers at application startup
Configuration: externalize pattern choices (which strategy, which factory) via environment variables or config files
Logging and observability: add structured logging inside pattern boundaries (e.g., log every command execution, every state transition)
Performance: patterns add indirection — profile before and after, and keep hot paths simple
Lecture 36 — Final Notes and Best Practices
Section: 7 · Duration: 4–5 min · Type: Video
Objective
Closing lecture: decision framework for when to apply a pattern, when to keep it simple, and resources for continued learning.
Core concepts
Decision checklist: apply a pattern when the problem recurs, the code grows, or the team needs a shared vocabulary
Anti-pattern warning: do not force a pattern where a function call suffices — premature abstraction is as harmful as premature optimization
Python-specific advice: prefer first-class functions (Strategy), generators (Iterator), and Protocols (all patterns) over deep class hierarchies
Continued learning: the GoF book for theory, Refactoring Guru for visual reference, Brandon Rhodes for Pythonic adaptations
Practice path: pick one pattern per week, find it in an open-source project, and refactor a personal project to use it
Design patterns are the shared vocabulary of professional software engineering. Every senior developer is expected to know them, every code review references them, and every system that survives past its first year uses them — whether the team named them or not. This course teaches the most important Gang of Four patterns through idiomatic Python, not through Java-era boilerplate.
Every pattern in the course follows the same structure: the problem, the anti-pattern, the refactored solution, and a test proving correctness. Code examples use typing.Protocol for structural subtyping, dataclasses for clean data holders, and pytest for verification — the same stack professional Python teams use today.
You will implement four creational patterns (Factory, Abstract Factory, Prototype, Builder), five structural patterns (Adapter, Bridge, Flyweight, Proxy, Facade), and six behavioral patterns (Command, Strategy, State, Observer, Template Method, Iterator). Each has a bad-to-good code transformation you can run locally.
The course opens with business modeling fundamentals and BPMN notation — because patterns emerge from business processes, not from memorizing UML. Section 2 includes an AI-assisted mapping lecture where you use an LLM to propose patterns for a described workflow, then validate and refine the suggestions. The final section covers validation with AI, promotion to production, and the YAGNI/SOLID balance that keeps patterns useful rather than ceremonial.
Enroll now and build the pattern vocabulary that makes your code reviews sharper, your architectures cleaner, and your refactoring stories shorter.