ddd icon indicating copy to clipboard operation
ddd copied to clipboard

Introduce value object interface / abstract

Open adenhertog opened this issue 6 years ago • 0 comments

Create a new base class (ie; ValueObject<PropertyType>) that can be inherited to create a value object concrete definition.

Value objects are a core concept of DDD and represent things that are identified by their value rather than their hash/id/reference etc. See: https://martinfowler.com/bliki/ValueObject.html

There're already some examples on the web on this practice in typescript (eg https://khalilstemmler.com/articles/typescript-value-object/) that can be used. This task can be used to create a similar base and exposed in ddd.

Side note: operator overloading provides a cleaner way to do this in other languages, but that doesn't appear to be coming to java/typescript: https://github.com/Microsoft/TypeScript/issues/6936

adenhertog avatar Apr 20 '19 05:04 adenhertog