OptionalgetReturns all command definitions for this context.
Commands represent write operations (state changes). Each command should have exactly one handler.
Array of command definitions (empty by default)
OptionalgetReturns all query definitions for this context.
Queries represent read operations (data retrieval). Each query should have exactly one handler.
Array of query definitions (empty by default)
OptionalgetReturns all event handler definitions for this context.
Event handlers react to domain events from this or other contexts. Multiple handlers can subscribe to the same event.
Array of event handler definitions (empty by default)
OptionalgetReturns all repository definitions for this context.
Repositories abstract persistence for aggregates in this context. Registered in the DI container during initialization.
Array of repository definitions (empty by default)
OptionalinitializeInitializes the context.
Called during application startup, after all required plugins and contexts are initialized. Register services in the container during this phase.
The context configuration
OptionalstartOptionalstopOptionalhealth
Context interface.
A Context represents a self-contained area of functionality in your application. It encapsulates all business logic, commands, queries, events, and repositories for a specific feature area.
Every context has three layers:
Contexts are:
Example