Book Profile
Architecture Patterns with Python
Harry J. W. Percival & Bob Gregory · 2020
A practical guide to applying Domain-Driven Design, Test-Driven Development, and Event-Driven Architecture patterns in Python to build maintainable, testable, and loosely coupled systems.
Get the book →Architecture Patterns with Python teaches Python developers how to manage growing complexity in real-world applications by systematically applying battle-tested architectural patterns drawn from the DDD, TDD, and microservices traditions. Starting from a concrete e-commerce allocation domain, the book walks step-by-step through building a layered architecture—Domain Model, Repository, Service Layer, Unit of Work, Aggregates—and then extends it into an event-driven system using Domain Events, a Message Bus, Commands, CQRS, and Dependency Injection. Every pattern is introduced test-first, with working Python code, explicit trade-off tables, and honest discussion of costs. By the end, readers have a blueprint for writing Python applications whose complexity grows slowly relative to their size, whose core business logic is fully decoupled from infrastructure, and whose test suites are fast, meaningful, and pyramidal.
What it argues
A causal model describing how architectural design levers (patterns, principles, and practices) shape intermediate code-quality and team-behavioral states, which in turn drive system-level outcomes such as maintainability, testability, and delivery speed.