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

eventSourceable mixin #57

Open
1 task
rhyslbw opened this issue Jan 25, 2016 · 12 comments
Open
1 task

eventSourceable mixin #57

rhyslbw opened this issue Jan 25, 2016 · 12 comments

Comments

@rhyslbw
Copy link
Member

rhyslbw commented Jan 25, 2016

Motivations:

  1. Apply the trait to domain.Entity, remove the need for a formal Aggregate class
  2. Reposition eventSourcing.Process as domain.Process
  3. Remove domain directory in space:event-sourcing https://github.com/meteor-space/event-sourcing/tree/develop/source/server, so it's positioned as an infrastructure package building on space:domain

I feel this will set us up for making Space's domain implementation less dependent on applying ES for every sub-domain.

Issues:

@rhyslbw
Copy link
Member Author

rhyslbw commented Jan 26, 2016

@DominikGuzei What's your opinion of this one? I really feel it needs to make the 3.x release since a breaking change here will impact data.

@DominikGuzei
Copy link
Member

Yeah this is a breaking change … so major version is necessary

@rhyslbw
Copy link
Member Author

rhyslbw commented Jan 26, 2016

…right, but my point is we'll need to hold off on 3.0.0 until this is done, and we're wanting to launch new projects on the 3.x track, so it's now or never

@DominikGuzei
Copy link
Member

Yeah, we should include it.
re: Process additional behaviour, i would just add it to the EventSourcable mixin for now. There never was a really good distinction between Aggregates / Process in our package anyway.

@rhyslbw
Copy link
Member Author

rhyslbw commented Jan 26, 2016

Agree. It's more of a concept, so we can actually get rid of the API and just include this in training and education

@rhyslbw rhyslbw modified the milestones: 4.0.0, 3.0.0 Jan 28, 2016
@rhyslbw
Copy link
Member Author

rhyslbw commented Jan 28, 2016

Ok so as discussed this has been punted to the next major release due to the breaking changes and priority to get 3.0.0 out. A mitigating action is to name snapshot types using the class name, as this will be forward compatible. However, as the snapshots collection is an ephemeral cache, it can be rebuilt on demand without impacting the system's integrity.

@rhyslbw
Copy link
Member Author

rhyslbw commented Jan 29, 2016

Have been thinking about this issue with @qejk in some depth, and now have more thoughts. Below is what we settled on:

We feel the best approach is to keep the current class and not extracting the functionality to a mixin since we really do need the concept of an aggregate class here but not in space:domain. Same goes for Process as it's fine being an extension of Aggregate with the additional ability to trigger commands.

Not related to this issue, but the real improvement we can make is to make Space.eventSourcing.Aggregate extended from Space.domain.Entity :-)

Thoughts @DominikGuzei @darko-mijic ?

@DominikGuzei
Copy link
Member

Yeah while "working" on it, i also had the feeling that this probably won't bring many benefits apart from "being more generalized" (which is not a benefit in itself). In general i would suggest to use mixins for only for stuff that is truly generalizable / can be applied to many different contexts / classes.

@DominikGuzei
Copy link
Member

Closed in favor of #63

@rhyslbw
Copy link
Member Author

rhyslbw commented Feb 14, 2016

@samhatoum raised a use-case in Slack for extracting the functionality to a plain object, so you don't have to use Space classes for your aggregate. I agree this would be a good move and make Space ES more accessible.

Food for thought:
http://raganwald.com/2015/06/17/functional-mixins.html

@rhyslbw rhyslbw reopened this Feb 14, 2016
@DominikGuzei
Copy link
Member

Hmm … not too sure about how we can keep all the things together while moving away from Space.Object, which provides a lot more options than a simple Object.assign call (e.g: onMixinApplied, onDependenciesReady callbacks, as well as hasMixin methods etc.). Another option would be to split up the space:base repository and extract useful concepts into node.js packages. Most code in space:base could be extracted as it has little todo with Meteor.

@rhyslbw
Copy link
Member Author

rhyslbw commented Feb 15, 2016

Another option would be to split up the space:base repository and extract useful concepts into node.js packages

👍 This would be a solid move

@rhyslbw rhyslbw removed this from the 4.0.0 milestone Feb 15, 2016
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

3 participants