Python
General-purpose language widely used for services and data work.
1 subject · 28 topics
Subjects covering this category
1 subject- Subject · Beginner to Advanced
Recognising the 23 classic design patterns from a class diagram or from code, and implementing each in Python, Java and TypeScript.
- Foundations
- Creational Patterns
- Structural Patterns
In Python itself
28 topics- Design Patterns
The Strategy pattern: putting each interchangeable algorithm behind one interface so the caller chooses it, and why in Python the strategy is often a function.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Template Method pattern: fixing the order of an algorithm's steps in a base class and letting subclasses supply the steps that differ.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Visitor pattern: adding operations over a fixed set of classes as separate visitor classes, how double dispatch finds the right method, and why a new element class is costly.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Singleton pattern: guaranteeing a class has exactly one instance with a global access point, and why it is the most criticised of the 23.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Proxy pattern: a stand-in with the same interface as a real object that controls when and whether calls reach it, and the self-call it never sees.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Observer pattern: letting many objects subscribe to one and be told when it changes, and the listener that is never unsubscribed.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Command pattern: turning a request into an object that can be queued, logged or undone, and what each command must remember to undo itself.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Iterator pattern: walking a collection one element at a time without knowing how it is stored, and why a Python generator can be walked only once.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Factory Method pattern: letting subclasses decide which class of object to create, so the code that uses the object never names it.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Builder pattern: constructing a complex object step by step, so a constructor with a dozen optional parameters is never needed.
Intermediate to Advanced9 cards · 4 qnot started
- Design Patterns
The Prototype pattern: creating new objects by copying a configured one, and the shallow copy trap that comes with it.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Decorator pattern: adding behaviour to an object by wrapping it in others with the same interface, and how it differs from Python's @ syntax.
Intermediate to Advanced8 cards · 5 qnot started
- Design Patterns
The Facade pattern: one simple interface in front of a complex subsystem, with the subsystem's classes still there for the cases the facade does not cover.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Composite pattern: treating a single object and a group of objects the same way, as in files and folders.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The State pattern: giving each state of an object its own class, so behaviour changes when the state changes, and deciding which class chooses the next state.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Chain of Responsibility pattern: passing a request along a chain of handlers until one deals with it, and ending every chain with an answer for requests nobody accepts.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Memento pattern: saving an object's state as a snapshot only that object can read, so it can be restored later, and keeping the snapshots from filling the memory.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Interpreter pattern: representing each rule of a small language as a class, evaluating a sentence as a tree of those objects, and knowing that parsing is a separate job.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Abstract Factory pattern: creating whole families of related objects through one interface, so a program can switch every product at once.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Adapter pattern: wrapping an existing class so it fits the interface a client already expects, without changing either side.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Bridge pattern: splitting what something is from how it is done into two hierarchies, so they grow without multiplying classes.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Flyweight pattern: sharing the common part of many small objects so that a program holding millions of them still fits in memory.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
The Mediator pattern: routing the communication between many objects through one coordinator, and counting the links it removes.
Intermediate to Advanced8 cards · 4 qnot started
- Design Patterns
What design patterns are: named, reusable solutions to recurring object-oriented design problems, how the 23 classic ones are grouped, and when one costs more than it saves.
Beginner to Intermediate8 cards · 5 qnot started
- Design Patterns
Reading UML class diagrams: the boxes, lines and arrowheads every design pattern is drawn with, and how each relationship looks in code.
Beginner to Intermediate8 cards · 5 qnot started
- Design Patterns
Choosing a creational design pattern: telling Factory Method, Abstract Factory, Builder, Prototype and Singleton apart, and when a plain constructor is enough.
Intermediate to Advanced5 cards · 4 qnot started
- Design Patterns
Choosing a structural design pattern: telling Adapter, Decorator, Facade, Proxy, Composite, Bridge and Flyweight apart by what each wrapper is for.
Intermediate to Advanced5 cards · 4 qnot started
- Design Patterns
Choosing a behavioural design pattern: telling Strategy, State, Template Method, Command, Observer, Mediator, Chain of Responsibility and Decorator apart by who decides and how many objects take part.
Intermediate to Advanced5 cards · 5 qnot started