@@ -20,27 +20,48 @@ Domain event interfaces following ISP (Interface Segregation Principle):
2020- ** Event** - Base domain event (eventId, eventName, payload, occurredOn)
2121- ** Traceable** - Distributed tracing (correlationId, causationId)
2222- ** Sourceable** - Event sourcing (aggregateId, aggregateType, eventVersion)
23+ - ** EventBus** - Publishes domain events
2324
2425## Application Layer
2526
2627### Command
2728Write operations (CQRS):
2829- ** Command** - Marker interface for state-changing operations
30+ - ** CommandBus** - Dispatches commands to handlers
31+ - ** CommandHandler** - Executes commands
2932
3033### Query
3134Read operations (CQRS):
3235- ** Query** - Marker interface for data retrieval
3336- ** QueryResponse** - Marker interface for query results
37+ - ** QueryBus** - Routes queries to handlers
38+ - ** QueryHandler** - Executes queries and returns responses
3439
3540### Handler
36- Message handlers:
37- - ** CommandHandler** - Executes commands
38- - ** QueryHandler** - Executes queries and returns responses
41+ Event handlers:
3942- ** EventHandler** - Reacts to domain events
4043
41- ### Messaging
42- Message bus implementations:
43- - ** CommandBus** - Dispatches commands
44- - ** QueryBus** - Asks queries
45- - ** EventBus** - Publishes events
46- - ** ServiceBus** - Unified bus facade
44+ ### Service Bus
45+ Unified message bus facade:
46+ - ** ServiceBus** - Provides access to CommandBus, QueryBus, and EventBus
47+
48+ ## Architecture
49+
50+ This library follows Clean Architecture principles with explicit layer separation:
51+ - ** Domain → Application** - Domain layer is independent, Application depends on Domain
52+ - ** Layer-Explicit Namespaces** - Clear architectural boundaries in namespace structure
53+ - ** Interface Segregation** - Compose only needed capabilities (e.g., Event + Traceable + Sourceable)
54+
55+ ### Architecture Testing
56+
57+ The project includes automated architecture tests using Pest PHP:
58+
59+ ``` bash
60+ composer test
61+ ```
62+
63+ Tests enforce:
64+ - Domain layer independence (no Application dependencies)
65+ - Correct interface placement and usage
66+ - Clean Architecture dependency rules
67+ - PHP and security best practices (via arch presets)
0 commit comments