Skip to content
codepb edited this page Jan 26, 2018 · 2 revisions

The core library provides the fundamental building blocks for domain driven design:

ValueObject

The ValueObject class is the base for any Value Object (an object defined by it's attributes). Inherit from this when you want equality to be defined by an object having all properties equal to another of the same type. It will compare the values of all public and instance properties for equality.

ValueObjects should be immutable as defined by DDD, but this is not enforced and you are free to implement a ValueObject however you choose.

Entity

The Entity class is the base for any Entity (an object defined by a conceptual id). Inherit from this when you want equality to be defined by an Id property equal to the Id property of another object of the same type. It will only compare for equality on the Id property.

The generic parameter T is the type of the Id property.

AggregateRoot

The AggregateRoot class is the base for any Aggregate Root (an entity that is the root of the Aggregate). This behaves exactly as Entity, but also implements IAggregateRoot to be able to be used with Repositories and Services.

The generic parameter T is the type of the Id property.

Clone this wiki locally