Book Description
As Python continues to grow in popularity, projects are becoming larger and more complex. Many Python developers are taking an interest in high-level software design patterns such as hexagonal/clean architecture, event-driven architecture, and the strategic patterns prescribed by domain-driven design (DDD). But translating those patterns into Python isn't always straightforward.
With this hands-on guide, Harry Percival and Bob Gregory from MADE.com introduce proven architectural design patterns to help Python developers manage application complexity - and get the most value out of their test suites.
Each pattern is illustrated with concrete examples in beautiful, idiomatic Python, avoiding some of the verbosity of Java and C# syntax. Patterns include:
- Dependency inversion and its links to ports and adapters (hexagonal/clean architecture);
- Domain-driven design's distinction between Entities, Value Objects, and Aggregates;
- Repository and Unit of Work patterns for persistent storage;
- Events, commands, and the message bus;
- Command-query responsibility segregation (CQRS);
- Event-driven architecture and reactive microservices.
This open book is licensed under a Creative Commons License (CC BY-NC-ND). Free download in PDF format is not available. You can read Architecture Patterns with Python book online for free.
Table of Contents
PART 1
Building an Architecture to Support Domain Modeling
Chapter 1
Domain Modeling
Chapter 2
Repository Pattern
Chapter 3
A Brief Interlude: On Coupling and Abstractions
Chapter 4
Our First Use Case: Flask API and Service Layer
Chapter 5
TDD in High Gear and Low Gear
Chapter 6
Unit of Work Pattern
Chapter 7
Aggregates and Consistency Boundaries
PART 2
Event-Driven Architecture
Chapter 8
Events and the Message Bus
Chapter 9
Going to Town on the Message Bus
Chapter 10
Commands and Command Handler
Chapter 11
Event-Driven Architecture: Using Events to Integrate Microservices
Chapter 12
Command-Query Responsibility Segregation (CQRS)
Chapter 13
Dependency Injection (and Bootstrapping)