implementing-the-clean-architecture
implementing-the-clean-architecture copied to clipboard
Implementing the Clean Architecture
This repository is meant to be a reference of many useful patterns when one implements projects using the Clean Architecture or Domain-Driven Design.
It also happens to be an example project for my book under the same title.
EN Implementing the Clean Architecture @ Leanpub
PL (also printed!) Implementowanie Czystej Architektury w Pythonie
Let's talk about it on Discord
Table of contents
-
Diagrams (coming soon)
- Big Picture Event Storming
- Context Map
- C4
- Tactical Patterns (coming soon)
- Components Integration Patterns (coming soon)
- Using with popular tools (more coming soon)
Diagrams
Coming soon
Tactical Patterns
Coming soon
Components Integration Patterns
Dependency Injection
- Assemble components to configure IoC Container (main)
- Nesting Injector's modules - nested and component-level one that's included in top-level's assemble
Integration via Direct component's API call
e.g. Process Manager directly calls Customer Relationship Facade
Integration via Port / Adapter
Integration via Events
Groundwork
- Event Bus (mediator) interface
- Injector-based Event Bus
- Handling of synchronous listeners
- Handling of asynchronous listeners
Example
- One component defines an Event and publishes it
- Another component subscribes to it using DI
- Another component handles the Event
Integration via Process Manager
- Process Manager itself (multilistener with keeping state)
- Subscriptions to Events using DI
- Handling Events using singledispatchmethod
Using with popular tools
Celery
- Creating instance as usual after building IoC Container, then setting it on an attribute
- Custom integration of Celery and Injector (coming soon)