Architecture Patterns with Python

Overall reception and scope

  • Many commenters call this one of the best Python architecture books they’ve read, often useful even to non‑Python devs (TypeScript, C#, .NET).
  • Praised for clear explanations of DDD, events, commands, CQRS, and for showing how to keep web/UI concerns at the edge so the same domain core can be reused (CLI, event subscribers, simulations, etc.).
  • Some used it successfully in non‑web contexts (e.g., industrial energy‑optimization, trading systems).

Static typing and Python type hints

  • Several readers miss stricter/static typing; others note the book does use hints in places but not uniformly.
  • Large subthread debates type hints:
    • Pro‑typing: makes code easier to understand, catches “surprise types,” improves design; type hints viewed as executable documentation.
    • Skeptical: annotations add visual clutter, shift focus away from naming and small functions; Python’s type system is unsound and can’t guarantee correctness.
    • Consensus among most: imperfect but still highly valuable; “better than nothing.”

Repository, Unit of Work, and data access

  • Major controversy over the repository pattern atop SQLAlchemy:
    • Critics: redundant abstraction over an ORM that is already a repository/UoW; often just forwards arguments; YAGNI for many services; can bloat code and slow development.
    • Supporters: keeps data access centralized, decouples domain from storage/ORM, simplifies testing and future swaps (DB, external APIs, message queues), especially in large systems.
  • Nuance: for simple apps or small services, it’s likely overkill; for complex domains or where swapping backends (queues, APIs, storage) is real, the pattern pays off.

Architectural patterns, DDD, and complexity

  • Many like the book as a catalog of useful patterns but warn that inexperienced devs can treat it as gospel and over‑pattern everything.
  • Multiple accounts of Python systems with strict “clean architecture” and DDD producing slow, over‑abstracted “architecture soup,” versus ugly but direct code that was easier to understand and modify.
  • Recurrent theme: patterns are tools, not goals; they add overhead and should be applied only when concrete needs justify the complexity.

Testing, fakes vs mocks, DI

  • Book is praised for test‑first style and patterns like fake unit of work/services for testing external systems.
  • Strong preference from several for fakes over mocks.
  • Lightweight dependency injection (passing collaborators as arguments or protocols) is seen as very effective; heavy DI frameworks in Python are widely disliked.

Broader views on Python, OOP, and DDD

  • Some are tired of heavy OOP, SOLID, and “enterprise” patterns, preferring pure functions, small I/O wrappers, and minimal objects (often dataclasses/Pydantic models).
  • Mixed feelings about DDD: some find it clarifying for domain language; others see it as over‑documented modeling that can delay shipping.
  • A few commenters dismiss Python itself as slow/buggy; others treat it as a practical glue language whose power comes largely from its C‑backed libraries.