sageserpent-open / plutonium

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

Support passing items in wrapper objects or collections as arguments to mutative methods. #44

Open sageserpent-open opened 6 years ago

sageserpent-open commented 6 years ago

Currently an event must perform all operations on items by either calling a mutator on a target item, or passing one or several items directly as arguments to a mutator call.

The aim here is to generalise this by allowing, say, a collection of items to be passed as a single argument to a mutator call.

sageserpent-open commented 6 years ago

An idea for implementation is to detect when making a snapshot of an item any inter-item references that aren't yet stored in the underlying blob storage. Once the snapshot has been completed, these items should in turn have snapshots made (which may cause further waves of snapshots to be made in an iterative fashion).

Note that the usual case is for a snapshot to be defined without bothering to serialize related items - the idea being not to generate snapshots for the sake of it, as these should only be created when something mutates. This issue captures the notion that if an item hasn't yet been snapshotted at all, we should make an honorary 'I have just been created and something refers to me' snapshot.

This is rather like the creation of a ghost, but is done to define a lifecycle, not fill in for the absence of one.