Architecture Patterns with Python: Enabling wholesale outlet online sale Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices online

Architecture Patterns with Python: Enabling wholesale outlet online sale Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices online

Architecture Patterns with Python: Enabling wholesale outlet online sale Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices online
Architecture Patterns with Python: Enabling wholesale outlet online sale Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices online__right


From the Preface

Who Should Read This Book

Here are a few things we assume about you, dear reader:

  • You’ve been close to some reasonably complex Python applications.
  • You’ve seen some of the pain that comes with trying to manage that complexity.
  • You don’t necessarily know anything about DDD or any of the classic application architecture patterns.

We structure our explorations of architectural patterns around an example app, building it up chapter by chapter. We use TDD at work, so we tend to show listings of tests first, followed by implementation. If you’re not used to working test-first, it may feel a little strange at the beginning, but we hope you’ll soon get used to seeing code “being used” (i.e., from the outside) before you see how it’s built on the inside.

We use some specific Python frameworks and technologies, including Flask, SQLAlchemy, and pytest, as well as Docker and Redis. If you’re already familiar with them, that won’t hurt, but we don’t think it’s required. One of our main aims with this book is to build an architecture for which specific technology choices become minor implementation details.

Origins of this book:

At the end of Harry’s last book, Test-Driven Development with Python (O’Reilly), he found himself asking a bunch of questions about architecture, such as, What’s the best way of structuring your application so that it’s easy to test? More specifically, so that your core business logic is covered by unit tests, and so that you minimize the number of integration and end-to-end tests you need? He made vague references to “Hexagonal Architecture” and “Ports and Adapters” and “Functional Core, Imperative Shell,” but if he was honest, he’d have to admit that these weren’t things he really understood or had done in practice.

And then he was lucky enough to run into Bob, who has the answers to all these questions. Bob ended up a software architect because nobody else on his team was doing it. He turned out to be pretty bad at it, but he was lucky enough to run into Ian Cooper, who taught him new ways of writing and thinking about code.

Our aim with this book is to introduce several classic architectural patterns and show how they support TDD, DDD, and event-driven services. We hope it will serve as a reference for implementing them in a Pythonic way, and that people can use it as a first step toward further research in this field.

Test-Driven Development with Python
Related content from O'Reilly Media

Description

Product 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

About the Author

After an idyllic childhood spent playing with BASIC on French 8-bit computers like the Thomson T-07 whose keys go "boop" when you press them, Harry Percival spent a few years being deeply unhappy as a management consultant. Soon he rediscovered his true geek nature, and was lucky enough to fall in with a bunch of XP fanatics, working on the pioneering but sadly defunct Resolver One spreadsheet. He worked at PythonAnywhere LLP, spreading the gospel of TDD world-wide at talks, workshops and conferences. He is now with MADE.COM.



Bob Gregory is a UK-based software architect with MADE.COM. He has been building event driven systems with domain-driven design for more than a decade.

Product information

Architecture Patterns with Python: Enabling wholesale outlet online sale Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices online

Architecture Patterns with Python: Enabling wholesale outlet online sale Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices online