Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate the clone-mutate update model in the event store #216

Open
erwinvaneyk opened this issue Sep 27, 2018 · 0 comments
Open

Deprecate the clone-mutate update model in the event store #216

erwinvaneyk opened this issue Sep 27, 2018 · 0 comments

Comments

@erwinvaneyk
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant