Hmmmm.
Load all events (as normal)
In your state accumulator, ignore events after desired effective date.
That seems like it would get you whatever state you need regardless of when the event came in.
For normal processing, you have to know whether the particular bit of state needs to be modified based on effective date. Maintaining last effective date per event processed seems like it should work.
--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "DDD/CQRS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dddcqrs+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Alberto,Right now I'm trying to wrap my head around the requirements, the restrictions I am running into dealing with CRUD and the desire for the product owner to want everything under the sun even if they end up having conflicting requirements. This post goes off rails a bit from just ES, and more general DDD/CQRS.
Right now, we sort of started with more of a data-driven design - and have ended up with a bit of 'one model to rule them all' - data = domain = read = write = the same to handle drafts, pending changes and concrete final versions. One model to rule them all, and it's making my head hurt and would like to make some changes before this area gets too much further along.On a high level, some of the other requirements.- Have draft records, and draft records that can reference other draft records - should be almost no constraints on what is saved (mix in with others wanting immediate consistency and strongly enforced FK constraints and not wanting to create draft tables / another data store for draft versions and then dealing with resolving relationships when things get approved ... and this is a mess)- post dated, and future dated changes- full audit history, both draft and final versions- ability to put any subset of changes through an approval workflow, of which do not get applied until final approval- full audit history on that approval, for example: gets submitted for approval, gets rejected, a field gets changed and submitted again - having a history of that - what fields changed, who did what when, how long it took between submission to rejection to re-submission, etc.- ability to load a work order for an 'as at' view and an 'as of' view (for a mix of audit reasons, and business process reasons to get data that we need to run a process)Things started out as largely CRUD for the first few months of the project, but now we are getting into the heart of the application, and this particular module really does not seem to fit with CRUD that well (a large part of the system fits fine with CRUD though).
I'm still pretty new to DDD/CQRS/ES - been sort of aware of it for awhile, but only really looking into it over the last month or two - but does seem to have clicked quite a bit with me in terms of how it could possibly solve some of the challenges I am facing.
Considering the main modules we have right now - Organization, Contact, Work Order, Time Sheet- a org can have many contacts, a contact can be associated to many organizations, work orders have relations to organizations and contacts and timesheets belong to a work order.- Seems like : Org, Contact, WO should be AR's - and only reference the others by ID- Org, Contact pretty much just can be a 'draft' during create, but once active - there will only be 1 version- Org, Contact - if a change is done, might have an approval flow - although the product owner is fine with just an 'audit log' of changes- Work Order has many child records (some entity, some value)- WO is one of the ones where being able to 'load it as it is/was at X time' is important- A WO could have many 'active' details (committed changes that are different versions of those details)- A WO could also have pending change requests (which may or may not need to be applied depending on if they get approved)
Personally, I think going with 'pending changes of a specific type' is a better way of going - rate change, termination, extension, approval change, payment party change, etc - but getting a lot of push back and others wanting 'one big CRUD request, even though what is changing in that request can imply a number of different intentions and business processes'. Changing an end date if a 'correction' is far different than changing an end date if it's a termination or an extension.
Although, I think the first challenge I need to overcome is getting appropriate domain experts involved. The person who responsible for most of the requirements more interested in the reporting data he can get out of the system, not the use of the system.