Architecture Patterns with Python. Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices

- Autorzy:
- Harry Percival, Bob Gregory


- Ocena:
- Bądź pierwszym, który oceni tę książkę
- Stron:
- 304
- Dostępne formaty:
-
ePubMobi
Opis ebooka: Architecture Patterns with Python. Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices
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
Wybrane bestsellery
-
Python zyskuje coraz większą popularność i jest wykorzystywany do tworzenia bardzo różnych aplikacji, jednak projektowanie dużych, niezawodnych systemów w tym języku bywa wyzwaniem. Rozwijanie złożonych systemów o wysokiej jakości wymaga zastosowania odpowiedniej architektury. Trudno w Pythonie s...
Architektura aplikacji w Pythonie. TDD, DDD i rozwój mikrousług reaktywnych Architektura aplikacji w Pythonie. TDD, DDD i rozwój mikrousług reaktywnych
-
W trakcie prezentowanego procesu poznasz podstawy Django, Selenium, git, jQuery i Mock, a także aktualnie stosowanych technologii programowania sieciowego. Jeżeli jesteś gotowy na podniesienie własnych umiejętności w zakresie programowania w Pythonie, ta książka wyraźnie pokazuje, że podejście op...
-
Ta książka jest kompleksowym wprowadzeniem do matematyki dyskretnej, przydatnym dla każdego, kto chce pogłębić i ugruntować swoje umiejętności informatyczne. W zrozumiały sposób przedstawiono tu metody matematyki dyskretnej i ich zastosowanie w algorytmach i analizie danych, włączając w to techni...
Matematyka dyskretna dla praktyków. Algorytmy i uczenie maszynowe w Pythonie Matematyka dyskretna dla praktyków. Algorytmy i uczenie maszynowe w Pythonie
(41.40 zł najniższa cena z 30 dni)44.85 zł
69.00 zł(-35%) -
Życie Harryego Hole się rozpadło. W akcie rozpaczy ekspolicjant leci do Los Angeles, by tam zapić się na śmierć. Nieubłaganie stacza się na dno, przesiadując w barze. Tutaj poznaje podstarzałą aktorkę Lucille. Kobieta jest zadłużona na niemal milion dolarów, co może mieć śmiertelne konsekwencje. ...(29.92 zł najniższa cena z 30 dni)
31.12 zł
39.90 zł(-22%) -
W agencji detektywistycznej Cormorana Strikea i Robin Ellacott zjawia się roztrzęsiona młoda kobieta i błaga o rozmowę. To Edie Ledwell, współtwórczyni popularnej kreskówki Serce jak smoła. Od lat prześladuje ją w Internecie osoba posługująca się nickiem Anomia. Zdesperowana Edie prosi o ustaleni...
Cormoran Strike prowadzi śledztwo (#6). Serce jak smoła Cormoran Strike prowadzi śledztwo (#6). Serce jak smoła
(47.92 zł najniższa cena z 30 dni)49.79 zł
63.90 zł(-22%) -
Superbohater ze ściany wschodniej powraca. Nieświeża onuca upchnięta w filcowo-gumowym kamaszu odciśnie swe piętno na obliczu świata (i na niejednej bardackiej gębie).(29.20 zł najniższa cena z 30 dni)
29.50 zł
37.43 zł(-21%) -
Psychokompetencje to inaczej kompetencje miękkie. Należą do nich między innymi umiejętności: budowania relacji, komunikacyjne, negocjacyjne, myślenia kreatywnego i krytycznego, a także adaptacji do zmieniających się warunków czy rozwiązywania konfliktów. Bez ich opanowania trudno osiągnąć sukces ...
PSYCHOkompetencje. 10 psychologicznych supermocy, które warto rozwijać PSYCHOkompetencje. 10 psychologicznych supermocy, które warto rozwijać
(29.40 zł najniższa cena z 30 dni)31.85 zł
49.00 zł(-35%) -
Ludobójstwo na Wołyniu, akcja Wisła, krwawa wojna o Lwów. Pogromy polskich dworów na Rusi, Pakt Piłsudski - Petlura, Wielki Głód i Dywizja SS-Galizien. Fatalne błędy II RP i terroryzm OUN. UPA kontra AK.(26.94 zł najniższa cena z 30 dni)
35.02 zł
44.90 zł(-22%) -
Trzy tysiące lat historii władzy skondensowanych w surowej esencji czterdziestu ośmiu praw. Synteza filozofii Machiavelliego, Sun-Tsu, Carla von Clausewitza i innych wielkich myślicieli.
48 praw władzy. Jak wykorzystać manipulację do osiągnięcia przewagi 48 praw władzy. Jak wykorzystać manipulację do osiągnięcia przewagi
(26.24 zł najniższa cena z 30 dni)26.94 zł
34.99 zł(-23%) -
W Tatrach Zachodnich dochodzi do zaginięcia młodej kobiety z Warszawy. Ostatnim razem widziana była przez turystów w okolicy Trzydniowiańskiego Wierchu, a potem przepadła bez wieści. Był to jej pierwszy wyjazd w góry, miała zamiar spędzić w nich tylko weekend, a w Zakopanem pojawiła się sama mimo...(19.74 zł najniższa cena z 30 dni)
26.32 zł
32.90 zł(-20%)
O autorze ebooka
Harry Percival niegdyś był konsultantem specjalizującym się w zarządzaniu, później brał udział w pracach nad arkuszem kalkulacyjnym Resolver One. Pracował w PythonAnywhere LLP i promował metodykę TDD na konferencjach, warsztatach i innych wydarzeniach na całym świecie. Teraz pracuje w MADE.com.
Kup polskie wydanie:
Architektura aplikacji w Pythonie. TDD, DDD i rozwój mikrousług reaktywnych
- Autor:
- Harry Percival, Bob Gregory
37,95 zł
69,00 zł
(34.50 zł najniższa cena z 30 dni)
Ebooka przeczytasz na:
-
czytnikach Inkbook, Kindle, Pocketbook, Onyx Boox i innych
-
systemach Windows, MacOS i innych
-
systemach Windows, Android, iOS, HarmonyOS
-
na dowolnych urządzeniach i aplikacjach obsługujących formaty: PDF, EPub, Mobi
Masz pytania? Zajrzyj do zakładki Pomoc »
Audiobooka posłuchasz:
-
w aplikacji Ebookpoint na Android, iOS, HarmonyOs
-
na systemach Windows, MacOS i innych
-
na dowolnych urządzeniach i aplikacjach obsługujących format MP3 (pliki spakowane w ZIP)
Masz pytania? Zajrzyj do zakładki Pomoc »
Kurs Video zobaczysz:
-
w aplikacji Ebookpoint na Android, iOS, HarmonyOs
-
na systemach Windows, MacOS i innych
-
na dowolnych urządzeniach i aplikacjach obsługujących format MP4 (pliki spakowane w ZIP)
Szczegóły ebooka
- ISBN Ebooka:
- 978-14-920-5215-9, 9781492052159
- Data wydania ebooka:
-
2020-03-05
Data wydania ebooka często jest dniem wprowadzenia tytułu do sprzedaży i może nie być równoznaczna z datą wydania książki papierowej. Dodatkowe informacje możesz znaleźć w darmowym fragmencie. Jeśli masz wątpliwości skontaktuj się z nami sklep@ebookpoint.pl.
- Język publikacji:
- angielski
- Rozmiar pliku ePub:
- 7.5MB
- Rozmiar pliku Mobi:
- 20.1MB
Spis treści ebooka
- Preface
- Managing Complexity, Solving Business Problems
- Why Python?
- TDD, DDD, and Event-Driven Architecture
- Who Should Read This Book
- A Brief Overview of What Youll Learn
- Part I, Building an Architecture to Support Domain Modeling
- Part II, Event-Driven Architecture
- Addtional Content
- Example Code and Coding Along
- License
- Conventions Used in This Book
- OReilly Online Learning
- How to Contact OReilly
- Acknowledgments
- Introduction
- Why Do Our Designs Go Wrong?
- Encapsulation and Abstractions
- Layering
- The Dependency Inversion Principle
- A Place for All Our Business Logic: The Domain Model
- I. Building an Architecture to Support Domain Modeling
- 1. Domain Modeling
- What Is a Domain Model?
- Exploring the Domain Language
- Unit Testing Domain Models
- Dataclasses Are Great for Value Objects
- Value Objects and Entities
- Not Everything Has to Be an Object: A Domain Service Function
- Pythons Magic Methods Let Us Use Our Models with Idiomatic Python
- Exceptions Can Express Domain Concepts Too
- 2. Repository Pattern
- Persisting Our Domain Model
- Some Pseudocode: What Are We Going to Need?
- Applying the DIP to Data Access
- Reminder: Our Model
- The Normal ORM Way: Model Depends on ORM
- Inverting the Dependency: ORM Depends on Model
- Introducing the Repository Pattern
- The Repository in the Abstract
- What Is the Trade-Off?
- Building a Fake Repository for Tests Is Now Trivial!
- What Is a Port and What Is an Adapter, in Python?
- Wrap-Up
- 3. A Brief Interlude: On Coupling and Abstractions
- Abstracting State Aids Testability
- Choosing the Right Abstraction(s)
- Implementing Our Chosen Abstractions
- Testing Edge to Edge with Fakes and Dependency Injection
- Why Not Just Patch It Out?
- Wrap-Up
- 4. Our First Use Case: Flask API and Service Layer
- Connecting Our Application to the Real World
- A First End-to-End Test
- The Straightforward Implementation
- Error Conditions That Require Database Checks
- Introducing a Service Layer, and Using FakeRepository to Unit Test It
- A Typical Service Function
- Why Is Everything Called a Service?
- Putting Things in Folders to See Where It All Belongs
- Wrap-Up
- The DIP in Action
- 5. TDD in High Gear and Low Gear
- How Is Our Test Pyramid Looking?
- Should Domain Layer Tests Move to the Service Layer?
- On Deciding What Kind of Tests to Write
- High and Low Gear
- Fully Decoupling the Service-Layer Tests from the Domain
- Mitigation: Keep All Domain Dependencies in Fixture Functions
- Adding a Missing Service
- Carrying the Improvement Through to the E2E Tests
- Wrap-Up
- 6. Unit of Work Pattern
- The Unit of Work Collaborates with the Repository
- Test-Driving a UoW with Integration Tests
- Unit of Work and Its Context Manager
- The Real Unit of Work Uses SQLAlchemy Sessions
- Fake Unit of Work for Testing
- Using the UoW in the Service Layer
- Explicit Tests for Commit/Rollback Behavior
- Explicit Versus Implicit Commits
- Examples: Using UoW to Group Multiple Operations into an Atomic Unit
- Example 1: Reallocate
- Example 2: Change Batch Quantity
- Tidying Up the Integration Tests
- Wrap-Up
- 7. Aggregates and Consistency Boundaries
- Why Not Just Run Everything in a Spreadsheet?
- Invariants, Constraints, and Consistency
- Invariants, Concurrency, and Locks
- What Is an Aggregate?
- Choosing an Aggregate
- One Aggregate = One Repository
- What About Performance?
- Optimistic Concurrency with Version Numbers
- Implementation Options for Version Numbers
- Testing for Our Data Integrity Rules
- Enforcing Concurrency Rules by Using Database Transaction Isolation Levels
- Pessimistic Concurrency Control Example: SELECT FOR UPDATE
- Wrap-Up
- Part I Recap
- II. Event-Driven Architecture
- 8. Events and the Message Bus
- Avoiding Making a Mess
- First, Lets Avoid Making a Mess of Our Web Controllers
- And Lets Not Make a Mess of Our Model Either
- Or the Service Layer!
- Avoiding Making a Mess
- Single Responsibility Principle
- All Aboard the Message Bus!
- The Model Records Events
- Events Are Simple Dataclasses
- The Model Raises Events
- The Message Bus Maps Events to Handlers
- Option 1: The Service Layer Takes Events from the Model and Puts Them on the Message Bus
- Option 2: The Service Layer Raises Its Own Events
- Option 3: The UoW Publishes Events to the Message Bus
- Wrap-Up
- 9. Going to Town on the Message Bus
- A New Requirement Leads Us to a New Architecture
- Imagining an Architecture Change: Everything Will Be an Event Handler
- A New Requirement Leads Us to a New Architecture
- Refactoring Service Functions to Message Handlers
- The Message Bus Now Collects Events from the UoW
- Our Tests Are All Written in Terms of Events Too
- A Temporary Ugly Hack: The Message Bus Has to Return Results
- Modifying Our API to Work with Events
- Implementing Our New Requirement
- Our New Event
- Test-Driving a New Handler
- Implementation
- A New Method on the Domain Model
- Optionally: Unit Testing Event Handlers in Isolation with a Fake Message Bus
- Wrap-Up
- What Have We Achieved?
- Why Have We Achieved?
- 10. Commands and Command Handler
- Commands and Events
- Differences in Exception Handling
- Discussion: Events, Commands, and Error Handling
- Recovering from Errors Synchronously
- Wrap-Up
- 11. Event-Driven Architecture: Using Events to Integrate Microservices
- Distributed Ball of Mud, and Thinking in Nouns
- Error Handling in Distributed Systems
- The Alternative: Temporal Decoupling Using Asynchronous Messaging
- Using a Redis Pub/Sub Channel for Integration
- Test-Driving It All Using an End-to-End Test
- Redis Is Another Thin Adapter Around Our Message Bus
- Our New Outgoing Event
- Internal Versus External Events
- Wrap-Up
- 12. Command-Query Responsibility Segregation (CQRS)
- Domain Models Are for Writing
- Most Users Arent Going to Buy Your Furniture
- Post/Redirect/Get and CQS
- Hold On to Your Lunch, Folks
- Testing CQRS Views
- Obvious Alternative 1: Using the Existing Repository
- Your Domain Model Is Not Optimized for Read Operations
- Obvious Alternative 2: Using the ORM
- SELECT N+1 and Other Performance Considerations
- Time to Completely Jump the Shark
- Updating a Read Model Table Using an Event Handler
- Changing Our Read Model Implementation Is Easy
- Wrap-Up
- 13. Dependency Injection (and Bootstrapping)
- Implicit Versus Explicit Dependencies
- Arent Explicit Dependencies Totally Weird and Java-y?
- Preparing Handlers: Manual DI with Closures and Partials
- An Alternative Using Classes
- A Bootstrap Script
- Message Bus Is Given Handlers at Runtime
- Using Bootstrap in Our Entrypoints
- Initializing DI in Our Tests
- Building an Adapter Properly: A Worked Example
- Define the Abstract and Concrete Implementations
- Make a Fake Version for Your Tests
- Figure Out How to Integration Test the Real Thing
- Wrap-Up
- Epilogue
- What Now?
- How Do I Get There from Here?
- Separating Entangled Responsibilities
- Identifying Aggregates and Bounded Contexts
- An Event-Driven Approach to Go to Microservices via Strangler Pattern
- Convincing Your Stakeholders to Try Something New
- Questions Our Tech Reviewers Asked That We Couldnt Work into Prose
- Footguns
- More Required Reading
- Wrap-Up
- A. Summary Diagram and Table
- B. A Template Project Structure
- Env Vars, 12-Factor, and Config, Inside and Outside Containers
- Config.py
- Docker-Compose and Containers Config
- Installing Your Source as a Package
- Dockerfile
- Tests
- Wrap-Up
- C. Swapping Out the Infrastructure: Do Everything with CSVs
- Implementing a Repository and Unit of Work for CSVs
- D. Repository and Unit of Work Patterns with Django
- Repository Pattern with Django
- Custom Methods on Django ORM Classes to Translate to/from Our Domain Model
- Repository Pattern with Django
- Unit of Work Pattern with Django
- API: Django Views Are Adapters
- Why Was This All So Hard?
- What to Do If You Already Have Django
- Steps Along the Way
- E. Validation
- What Is Validation, Anyway?
- Validating Syntax
- Postels Law and the Tolerant Reader Pattern
- Validating at the Edge
- Validating Semantics
- Validating Pragmatics
- Index
O'Reilly Media - inne książki
-
The way developers design, build, and run software has changed significantly with the evolution of microservices and containers. These modern architectures offer new distributed primitives that require a different set of practices than many developers, tech leads, and architects are accustomed to...(211.65 zł najniższa cena z 30 dni)
228.65 zł
269.00 zł(-15%) -
Learn how to build end-to-end scalable machine learning solutions with Apache Spark. With this practical guide, author Adi Polak introduces data and ML practitioners to creative solutions that supersede today's traditional methods. You'll learn a more holistic approach that takes you beyond speci...(262.65 zł najniższa cena z 30 dni)
271.15 zł
319.00 zł(-15%) -
What is eBPF? With this revolutionary technology, you can write custom code that dynamically changes the way the kernel behaves. It's an extraordinary platform for building a whole new generation of security, observability, and networking tools.This practical book is ideal for developers, system ...(186.15 zł najniższa cena z 30 dni)
194.65 zł
229.00 zł(-15%) -
Combing the web is simple, but how do you search for data at work? It's difficult and time-consuming, and can sometimes seem impossible. This book introduces a practical solution: the data catalog. Data analysts, data scientists, and data engineers will learn how to create true data discovery in ...(220.15 zł najniższa cena z 30 dni)
228.65 zł
269.00 zł(-15%) -
This updated edition of the Nutshell guide not only helps experienced Java programmers get the most out of versions through Java 17, it also serves as a learning path for new developers. Chock-full of examples that demonstrate how to take complete advantage of modern Java APIs and development bes...(220.15 zł najniższa cena z 30 dni)
228.65 zł
269.00 zł(-15%) -
Get started with Ray, the open source distributed computing framework that simplifies the process of scaling compute-intensive Python workloads. With this practical book, Python programmers, data engineers, and data scientists will learn how to leverage Ray locally and spin up compute clusters. Y...(220.15 zł najniższa cena z 30 dni)
228.65 zł
269.00 zł(-15%) -
Remove your doubts about AI and explore how this technology can be future-proofed using blockchain's smart contracts and tamper-evident ledgers. With this practical book, system architects, software engineers, and systems solution specialists will learn how enterprise blockchain provides permanen...(262.65 zł najniższa cena z 30 dni)
271.15 zł
319.00 zł(-15%) -
FinOps brings financial accountability to the variable spend model of cloud. Used by the majority of global enterprises, this management practice has grown from a fringe activity to the de facto discipline managing cloud spend. In this book, authors J.R. Storment and Mike Fuller outline the proce...(262.65 zł najniższa cena z 30 dni)
271.15 zł
319.00 zł(-15%) -
Edge AI is transforming the way computers interact with the real world, allowing IoT devices to make decisions using the 99% of sensor data that was previously discarded due to cost, bandwidth, or power limitations. With techniques like embedded machine learning, developers can capture human intu...(262.65 zł najniższa cena z 30 dni)
271.15 zł
319.00 zł(-15%) -
Why is it difficult for so many companies to get digital identity right? If you're still wrestling with even simple identity problems like modern website authentication, this practical book has the answers you need. Author Phil Windley provides conceptual frameworks to help you make sense of all ...(186.15 zł najniższa cena z 30 dni)
194.65 zł
229.00 zł(-15%)
Dzieki opcji "Druk na żądanie" do sprzedaży wracają tytuły Grupy Helion, które cieszyły sie dużym zainteresowaniem, a których nakład został wyprzedany.
Dla naszych Czytelników wydrukowaliśmy dodatkową pulę egzemplarzy w technice druku cyfrowego.
Co powinieneś wiedzieć o usłudze "Druk na żądanie":
- usługa obejmuje tylko widoczną poniżej listę tytułów, którą na bieżąco aktualizujemy;
- cena książki może być wyższa od początkowej ceny detalicznej, co jest spowodowane kosztami druku cyfrowego (wyższymi niż koszty tradycyjnego druku offsetowego). Obowiązująca cena jest zawsze podawana na stronie WWW książki;
- zawartość książki wraz z dodatkami (płyta CD, DVD) odpowiada jej pierwotnemu wydaniu i jest w pełni komplementarna;
- usługa nie obejmuje książek w kolorze.
W przypadku usługi "Druk na żądanie" termin dostarczenia przesyłki może obejmować także czas potrzebny na dodruk (do 10 dni roboczych)
Masz pytanie o konkretny tytuł? Napisz do nas: sklep[at]helion.pl.
Książka, którą chcesz zamówić pochodzi z końcówki nakładu. Oznacza to, że mogą się pojawić drobne defekty (otarcia, rysy, zagięcia).
Co powinieneś wiedzieć o usłudze "Końcówka nakładu":
- usługa obejmuje tylko książki oznaczone tagiem "Końcówka nakładu";
- wady o których mowa powyżej nie podlegają reklamacji;
Masz pytanie o konkretny tytuł? Napisz do nas: sklep[at]helion.pl.


Oceny i opinie klientów: Architecture Patterns with Python. Enabling Test-Driven Development, Domain-Driven Design, and Event-Driven Microservices Harry Percival, Bob Gregory (0)
Weryfikacja opinii następuję na podstawie historii zamówień na koncie Użytkownika umieszczającego opinię. Użytkownik mógł otrzymać punkty za opublikowanie opinii uprawniające do uzyskania rabatu w ramach Programu Punktowego.