You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For an early implementation of the fes package, we went for a Java-like inheritance approach for the updating of event store models. Each one required 'extending' the fes.BaseEntity and implementing the fes.Entity interface to support copying and state mutation.
Since our Golang expertise has grown, and we have more experience with using event sourcing, this clone-mutate approach has turned out not to be the best idea. It complicates the code a lot, with few (if any) benefits.
To simplify the codebase, we should probably remove the current clone-mutate approach, use cache.GetAggregate for everything, and ensure that ApplyEvent(entity, events) (entity, error) does not mutate state.
The text was updated successfully, but these errors were encountered:
For an early implementation of the
fes
package, we went for a Java-like inheritance approach for the updating of event store models. Each one required 'extending' the fes.BaseEntity and implementing the fes.Entity interface to support copying and state mutation.Since our Golang expertise has grown, and we have more experience with using event sourcing, this clone-mutate approach has turned out not to be the best idea. It complicates the code a lot, with few (if any) benefits.
To simplify the codebase, we should probably remove the current clone-mutate approach, use
cache.GetAggregate
for everything, and ensure thatApplyEvent(entity, events) (entity, error)
does not mutate state.The text was updated successfully, but these errors were encountered: