sageserpent-open / plutonium

CQRS providing bitemporal object modelling for Java POJOs and Scala too.
MIT License
5 stars 0 forks source link

Deal with changes in client object models. #56

Open sageserpent-open opened 5 years ago

sageserpent-open commented 5 years ago

This has three aspects:

  1. If an event encoding changes in client code, should Plutonium be responsible for dealing with this? I'm not sure if that question even makes sense, as the event would have been submitted to Plutonium as part of a revision, and can be corrected anyway if the encoding does change later.

  2. If the client object model changes in a way that breaks binary compatibility, then Plutonium should detect that either its stored event patches or its item state blobs are no longer valid - but then what?

  3. If the client model changes in a way that keeps binary compatibility buts breaks deserialization of the item state blobs, Plutonium could try to rebuild the timelines, using the stored event patches - in other works, do incremental recalculation from the broken blobs to rebuild them.

What would trigger such detection? Presumably failure to revise or to query - but should this simply be a detection followed by an explicit repair procedure, as one would want to sort out all broken blobs in a timeline, not just the odd one or two. Come to think of it, perhaps doing it per-blob on the fly is a good idea - incremental recalculation would probably fix lots of other damaged blobs into the bargain.

Should the repair apply to the latest revision and make a new revision, or should we be able to repair any existing revision, mutating the existing timeline for that revision?