Comments (8)
Hi @Toflar :)
This functionality is currently not included in EventSauce. The main reason for this is that an aggregate root is responsible for making decisions and should do that based on the latest info. Going back into history is something that would be possible by making using read-models that directly read from the message repository.
Perhaps you can explain what specific case you're trying to support. My guess if that you're using the aggregate root for reads, which is generally a bit of an anti-pattern. But curious to hear what your specific case is all about.
from eventsauce.
The idea would be that the projection would resolve the messages from the repository when asking for the state at a given point in time, so no need to pre-compile it for every step. Basically it would be as expensive as loading two aggregate roots, which should be quite alright.
from eventsauce.
Defintely, thanks!
from eventsauce.
I see your point. It really is a read operation so it should probably indeed not be part of the aggregate.
Basically I'm working on some POC for a general content repository to store whatever content. If you check my OSS contributions on GitHub you can kinda guess where I'm coming from 😉 We're talking CMS stuff here.
And I think a typical use case would be a user that wants to compare the current version of a content node with the previous one or the one of 30 days ago etc.
So having a projection for that sounds a bit inflexible because projections require to know in advance what the user would want to compare.
from eventsauce.
Yep, that's what I did now and it works perfectly 😉 Thanks!
Since the EventSauce docs are so well written, what do you think of an FAQ section for questions like this? I could of course contribute 😊
from eventsauce.
Awesome, yes. We can can create a section for case studies, or common problems with solution. Contribution would be much appreciated.
from eventsauce.
#180 :)
from eventsauce.
I'll consider this fixed with the addition of the documentation :)
from eventsauce.
Related Issues (20)
- Message::withHeader() no longer allows array value HOT 2
- Doubt about aggregate root version HOT 4
- Isn't replaying domain message events by default slow as hell HOT 15
- Examples of persisting snapshots to a database HOT 2
- Aggregate root HOT 3
- Projections
- Structure table
- Suggest snapshotting change HOT 2
- AggregateRootBehaviour should have a template on AggregateRootId HOT 3
- Use lambdas insterad of command objects? HOT 4
- DefaultHeadersDecorator order parameters deprecated HOT 6
- Move all tests to separate folder tests HOT 2
- Missing "id" reference in docs HOT 1
- DoctrineOutboxRepository reserved words escaping HOT 1
- Type mismatched... Expected `AggregateRootId` found `AggregateRootIdType` HOT 1
- Storing messages in MongoDB HOT 2
- Help needed... Preconditions are not working in test scenarios HOT 2
- Your inputs on this would be very helpful
- PayloadSerializerSupportingObjectMapperAndSerializablePayload does not work recursively
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eventsauce.