sageserpent-open / plutonium

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

Rework or extend the scope API as a session. #59

Open sageserpent-open opened 5 years ago

sageserpent-open commented 5 years ago

The implementation work in #16 has introduced the concept of working in a session, where data is loaded on demand from the backend storage in the session.

This isn't exposed in the client API, so clients are not aware that conducting a long interaction with a scope can result in many separate loads from the back end storage, any of which may unexpectedly fail due to hardware issues, network errors, etc.

Perhaps the API should reflect this, although given that a client can only query a scope, maybe it isn't so important. Anyway, this issue is here as a reminder that it needs thinking about.

sageserpent-open commented 5 years ago

A test for applicative laws conformance in 'BitemporalBehaviours' was disabled in 0b56104721e7f1391e1d5985bf5d5b193d46d029 - this is down to a failure introduced by the leakage of imperative behavior of the backend storage affecting the equality test between bitemporal instances when they are rendered by the equality check.

Sorting out a session for working with scopes would solve this issue, or alternatively the 'Bitemporal' type could be cutover to being a proper Cats free monad, so the testing is claimed for free, courtesy of Cats' own testing.

Either way I'll leave it here as part of this issue to pick up that technical debt.