When using type
fields on a domain model, there is logic associated depending on the value of the type. The type
field means something else in different contexts.
To decouple contexts the logic inside of each context should not know about the type but only about the data that is needed for that context.
Another layer orchestrates the different contexts.
When adding a new case for type
, only the orchestrating layer changes. All the contexts stay untouched.
Pro:
types
types
type
values