[ 
http://issues.ops4j.org/browse/QI-221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13310#action_13310
 ] 

Rickard Öberg commented on QI-221:
----------------------------------

No, not implemented in the domain model. When the calls reach the domain model 
it's already "too late". Once the calls go through the domain model there would 
typically be no way to undo/redo, not in the general case anyway. What you'd 
want instead is to work with values representing the domain state, and then do 
redo/undo on that state, until you decide to commit, or "save", which will 
execute the changes in the domain model and after which you cannot undo/redo 
again.

If that is the assumed model, then it becomes easier because values are 
immutable. So whenever the client wants to change something it actually has to 
create a mutable copy of the state, and so you don't have to keep track of what 
methods do what, just the references to versions of the values you want to 
undo/redo operations on.

Does that make sense to you?

Again: once the calls reach the actual domain model, that's that. You can't 
undo that. Something that has happened, has happened. But, building up the list 
of changes to perform on the domain model is still "in the air", and can hence 
support undo/redo. And if based on values, it becomes even more natural as each 
operation will be creating a new copy of the values, since values are immutable.

> Check nested UnitOfWork code so that it works properly.
> -------------------------------------------------------
>
>                 Key: QI-221
>                 URL: http://issues.ops4j.org/browse/QI-221
>             Project: Qi4j
>          Issue Type: Bug
>            Reporter: Rickard Öberg
>            Assignee: Rickard Öberg
>            Priority: Critical
>             Fix For: 1.0
>
>


-- 
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