vlingo / xoom-symbio

The VLINGO XOOM platform SDK delivering Reactive storage that is scalable, high-throughput, and resilient for CQRS, Event Sourcing, Key-Value, and Objects used by services and applications.
https://vlingo.io
Mozilla Public License 2.0
40 stars 9 forks source link

The mapping registration should be moved outside ObjectStore #15

Closed alexguzun closed 5 years ago

alexguzun commented 5 years ago

Curently the ObjectStore protocol defines a method used to register mapping for a given persistent type.

void registerMapper(final PersistentObjectMapper mapper);

Most of the stores simply proxy the call to their persistent delegates and do nothing more. With the introduction of io.vlingo.symbio.store.dispatch.Dispatchable the store has to have the mapping for it. Also a copy of the store delegate is usually used by DispatcherControlActor actor. More details in this discussion: https://github.com/vlingo/vlingo-symbio-jdbc/pull/14#discussion_r301147391

It makes more sense to register the mapping directly with the persistent delegate. The idea is to create an interface, for example ObjectStoreDelegate that defines the registerMapper implementation.

This will allow the clients to register all the necessary mappings, including the one for io.vlingo.symbio.store.dispatch.Dispatchable before creating the actor.

With the new Object store delegate interface, the following projects must also be changed:

VaughnVernon commented 5 years ago

@alexguzun I like it. When you are ready, please implement this.

alexguzun commented 5 years ago

Fixed by https://github.com/vlingo/vlingo-symbio/pull/16