Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Design Patterns with Python: A Practical Guide
3 students

Design Patterns with Python: A Practical Guide

Master GoF patterns with idiomatic Python: factory, strategy, observer, adapter, from theory to production code.
Created byRicardo Cataldi
Last updated 5/2026
English

What you'll learn

  • Learn the concepts of Design Patterns and how to apply them
  • Develop more concise and cohesive software with the correct application of patterns
  • Understand how to construct the main design patterns in Python
  • Understand how to integrate different design patterns with Python
  • Evaluate real situations where design patterns can be applied

Course content

7 sections • 37 lectures • 6h 45m total length
  • Entry Note — How This Course Was Made2:39
  • Course Introduction10:37

    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

  • How My Udemy Courses Work11:26

    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

  • What Are Design Patterns?11:48

    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?

  • Categories of Design Patterns11:55

    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

  • Why Python?11:17

    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

  • Installing Python and VS Code10:46

    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

  • Setting Up the Standard Environment12:40

    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)

  • Quiz: Introduction

Requirements

  • Intermediate knowledge in the Python language
  • Basic knowledge in software development lifecycle
  • Basic knowledge in business logic
  • Basic knowledge in Algorithms and Data Structures

Description

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.

Who this course is for:

  • Basic and composed data structures of Python
  • Intermediate understanding on Algorithms and Data Structures
  • Basic understanding of design patterns