Skip to content

Domain Layer

The Domain Layer contains the core business logic. It is completely independent of infrastructure concerns.

In This Section

Key Principles

Independence: The Domain Layer has no dependencies on other layers. It defines interfaces (ports) that infrastructure implements.

Immutability: Entities and Value Objects are readonly classes. State changes return new instances.

Self-Validation: Value Objects validate their data in constructors. Invalid data cannot exist.

Ubiquitous Language: Class and method names reflect business terminology.