Open
Description
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: microsoft/TypeScript#6936