fission-workflows icon indicating copy to clipboard operation
fission-workflows copied to clipboard

Deprecate the clone-mutate update model in the event store

Open erwinvaneyk opened this issue 6 years ago • 0 comments

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.

erwinvaneyk avatar Sep 27 '18 10:09 erwinvaneyk