Object-Oriented Design Patterns in Python - Chain of Responsibility
Pass a request along a sequence of potential handlers. Ideal for middleware, event handling, and logging, this pattern cleanly decouples the sender from the receiver.
Object-Oriented Design Patterns in Python - The Template Method
Define the skeleton of an algorithm while letting subclasses fill in the details. A perfect pattern for enforcing structure while maximizing code reuse.
Object-Oriented Design Patterns in Python - The Iterator Pattern
Navigate collections without exposing internal structure. We will deep-dive into Python’s __iter__ and __next__, comparing traditional iterators with powerful Python Generators.
Object-Oriented Design Patterns in Python - The Command Pattern
Turn requests into stand-alone objects. We’ll explore how to encapsulate actions, enabling powerful features like job queues, transactional systems, and Undo/Redo mechanisms.
Object-Oriented Design Patterns in Python - The Strategy Pattern
Swap algorithms on the fly! Learn to encapsulate behaviors into interchangeable objects, and see how Python’s first-class functions can simplify this pattern to a single line.
Member discussion