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 architecture patterns such as hexagonal/clean architecture, event-driven architecture, and strategic patterns prescribed by domain-driven design (DDD). But translating those patterns into Python isn't always straightforward.
With this practical guide, Harry Percival and Bob Gregory from MADE.com introduce proven architectural design patterns to help Python developers manage application complexity. Each pattern is illustrated with concrete examples in idiomatic Python that explain how to avoid some of the unnecessary verbosity of Java and C# syntax. You'll learn how to implement each of these patterns in a Pythonic way.
Architectural design 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
Книга очень хорошо начинается, первая ее четверть посвящена действительно замечательным идеям. Но потом всё портится. Недостатка, собственно, два. Первый - стиль изложения: в каждой новой главе говорится, что решение, построенное в предыдущей, не самое оптимальное и поэтому будем его переделывать. То есть из главы в главу нас учат сначала делать неправильно, потом тыкают в это носом и затем всё исправляем. А в следующей главе ситуация повторяется. Такой подход быстро начинает напрягать. И второй недостаток - чрезмерная сложность архитектуры и дизайна. Порой возникает ощущение, что читаешь книгу не о питоне, а о джаве или ином языке, не отличающемся большой динамичностью. В питоне почти всё, о чем пишут авторы, можно сделать намного проще.