-
-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
enhancementNew feature or requestNew feature or requestlinearSync the issue to LinearSync the issue to Linear
Description
For a while, I advocated treating events as contracts and keeping them clean of sophisticated types like value objects.
It solves the issue of serialisation as it should work unconditionally, but it introduces some issues:
- Repeated wrapping and unwrapping of value objects in the aggregate and the state code
- Applying mapping attributes (which are infrastructure-oriented) to domain events
- Lack of persistence control from the domain model side (I might not want to persist all the events)
Similar to #82, it is possible to map persisted events to domain events (and back) to separate those concerns.
Here's the idea:
- Add an optional two-way mapping
- Treat it as an addition, meaning look inside the map first and pass through unmapped types
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestlinearSync the issue to LinearSync the issue to Linear