Library for Command/Event support
---------------------------------

                 Key: QI-209
                 URL: http://issues.ops4j.org/browse/QI-209
             Project: Qi4j
          Issue Type: New Feature
            Reporter: Niclas Hedhman
            Assignee: Rickard Öberg
             Fix For: 1.0


We should create a library to support a Commond/Event pattern, where commands 
(methods in interfaces) triggers events which are recorded and can be played 
back later in time.

The suggested solution is basically;

If a method is marked @Command, then the CommandQueueSideEffect is attached, 
and will pass the invoked method to a CommandService, which will persist the 
commands and allow the commands to be replayed later. This is all optional, as 
Command playback has the disadvantage of not recreating the same UUIDs.

The typical mixin then goes on and implements the "Command" in a regular 
fashion, and typically calls a number of methods on private mixins. And if 
those are marked with @Event, the EventQueueConcern is attached, which will (if 
in recording mode, done with ThreadLocal on EventQueueService) forward the 
events to the EventService, which in turn will persist the events.

Upon startup, it is possible to tell the EventQueueService that 'playback' is 
wanted. The EventQueueService will then locate each of the entities, and invoke 
the methods on the @Event methods as previously. 

The Events and Commands should be saved in a JSON format in a store optimized 
for "adding" and "locate+enumerate" operations.

This will allow the domain model to rebuild the snapshot view from scratch at 
any point in time.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to