Patterns
Code-level design patterns: reusable solutions for structuring and constructing objects within a service, as distinct from the broader architectural styles in the parent Architecture section (how a whole system is organized, how services communicate). The architectural goal these two patterns exist to satisfy — Dependency Inversion — lives one level up, in Architecture itself, rather than here.
Articles
- Dependency Injection with Protocols —
structural typing with
typing.Protocolinstead of ABC inheritance, and why that avoids hierarchy hell. - Factory Pattern in Python — from a plain function to
registries to
@classmethodalternative constructors.
Contributing
Picked up a design pattern worth documenting — GoF-style or a Pythonic take on one? Add it here as its own file. See Contributing for the how-to.