Architecture Patterns with Python: Enabling Test-Driven Development,Domain-Driven Design,and Event-Driven Microservices
by: Harry Percival and Bob Gregory
Print Length 页数: 292 pages
Publisher finelybook 出版社: O’Reilly Media; 1 edition (March 24,2020)
Language 语言: English
ISBN-10: 1492052205
ISBN-13: 9781492052203
Book Description
As Python continues to grow in popularity,projects are becoming larger and more complex. Many Python developers are now 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
Introduction
1. Building an Architecture to Support Domain Modeling
1. Domain Modeling
2. Repository Pattern
3.A Brief Interlude: On Coupling and Abstractions
4. Our First Use Case: Flask API and Service Layer
5. TDD in High Gear and Low Gear
6. Unit of Work Pattern
7. Aggregates and Consistency Boundaries
Il. Event-Driven Architecture
8. Events and the Message Bus
9. Going to Town on the Message Bus
10. Commands and Command Handler
11. Event-Driven Architecture: Using Events to Integrate Microservices
12. Command-Query Responsibility Segregation(CQRS)
13. Dependency Injection(and Bootstrapping)
Epilogue
A. Summary Diagram and Table
B.A Template Project Structure
C. Swapping Out the Infrastructure: Do Everything with CSVs
D. Repository and Unit of Work Patterns with Django
E. Validation
Index