BoundedContext
Defines a bounded context in domain-driven design (DDD).
A bounded context represents a coherent area of the business domain with clear boundaries, containing its own ubiquitous language, domain model, and business rules. It defines the scope where particular terms and rules apply.
This annotation helps organize the codebase by grouping related aggregates and establishing clear boundaries between different business domains.
Example usage:
@BoundedContext(
name = "ecommerce",
alias = "shop",
description = "Handles online retail operations",
aggregates = [
BoundedContext.Aggregate(
name = "order",
tenantId = "tenant-1"
),
BoundedContext.Aggregate(
name = "product",
tenantId = "tenant-1"
)
]
)Parameters
The unique name of the bounded context. Used for identification and configuration.
An optional alias for the bounded context, useful for shorter references.
A human-readable description of the bounded context's purpose and scope.
Array of scope identifiers that define the context's boundaries.
Array of package classes that define which packages belong to this context.
Array of aggregate definitions within this bounded context.
See also
for defining aggregates within a bounded context