领域驱动设计实体和值对象

Domain-Driven-Design Entities and Value Objects

在 DDD 中建模的每个类型都必须是实体或值对象吗?

不,在 DDD 中您可以为以下类型的对象建模:

Domain Event: A domain object that defines an event. Where a domain event is something that happened that domain experts care about.

Service: When an operation does not conceptually belong to any object. Following the natural contours of the problem, you can implement these operations in services.

Repository: methods for retrieving domain objects should delegate to a specialized Repository object such that alternative storage implementations may be easily interchanged.

Factory: methods for creating domain objects should delegate to a specialized Factory object such that alternative implementations may be easily interchanged.