Architecture Overview¶
ascetic-ddd is a DDD toolkit and seedwork library organized into two main layers:
Seedwork Layer¶
The ascetic_ddd.seedwork package provides foundational abstractions:
Domain primitives: Aggregate, Entity, Value Object, identity
Session management: Unit of Work pattern with PostgreSQL support
Observable: Observer pattern for domain events
Repository: Base repository interfaces and PostgreSQL implementation
Application Modules¶
Built on top of the seedwork:
Specification: Query criteria using JSONPath and lambda-based filters
Outbox: Transactional outbox pattern for reliable event publishing
Inbox: Idempotent message processing
Saga: Distributed transaction coordination
Event Bus: In-process event routing
Mediator: Command/query dispatching
Faker: Test data generation with provider topology and distribution strategies
Package Structure¶
ascetic_ddd/
+-- seedwork/ # Foundational DDD abstractions
| +-- domain/ # Aggregate, Entity, Value Object, Identity
| +-- infrastructure/ # PostgreSQL repositories, event store
+-- specification/ # Specification pattern implementations
+-- outbox/ # Transactional outbox
+-- inbox/ # Idempotent inbox
+-- saga/ # Saga orchestration
+-- event_bus/ # In-process event bus
+-- mediator/ # Command/query mediator
+-- observable/ # Observer pattern
+-- session/ # Session/UoW management
+-- batch/ # Batch processing utilities
+-- faker/ # Test data generation framework
+-- utils/ # Shared utilities
+-- factory.py # Factory helpers
Design Principles¶
Ascetic: Minimal abstractions, no unnecessary complexity
Explicit over implicit: Clear interfaces, no magic
Let it crash: Natural exceptions over custom wrappers
Portability: Design with potential Go port in mind
C-style formatting:
%s/%dinstead of f-strings for cross-language consistency