Learn
Architecture and boundaries
Place domain contracts, technical sources, repositories, and composition responsibilities in the correct layer.
Architecture and boundaries
Domain
The domain declares Repository interfaces in business language. They may expose entities, immutable aggregate data, streams, and operations. They do not expose transport DTOs, database rows, storage clients, or DataSourceContainer.
Data
The Data layer owns typed DataSource contracts, technical implementations, mapping, cache policy, and the concrete Repository. It converts technical records into domain data before committing them.
Application
UseCases and application services depend on the domain Repository interface. An application-owned binding may turn a committed data change into a regular UseCase Forge Command; that mapping is application behavior.
Composition
The Composition Root constructs clients, DataSources, small repository-specific containers, repositories, UseCases, and bindings. It closes the object graph in reverse dependency order.