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

Falko Bräutigam commented on QI-221:
------------------------------------

First, thanks for your response, Rickard.

Now, I'm not sure I'm getting you right. The "operations" are nested, 
non-persistent, undoable, long living, and of course working against their 
parent UnitOfWork. There can be hundreds of operations in the stack of one user 
session. For example the chain of operations could be: "create a map", then 
"add a layer", "rename the layer"... But: the (changing) entities are spread 
over the UI. Frankly, I don't see how I should update the UI, if and after I 
made a mutable copy of the state? The operation could hold that state and 
discard on undo(), ok. But how does the UI get to know this?

An example of an operation:

@Concerns( OperationBoundsConcern.class )
@Mixins( NewMapOperation.Mixin.class )
public interface NewMapOperation
        extends IUndoableOperation, TransientComposite {

    public static abstract class Mixin
            extends AbstractOperation
            implements NewMapOperation {
        
        private IMap                        parent;
        private String                      mapName;
        private String                      crsCode;

        public IStatus execute( IProgressMonitor monitor, IAdaptable info )
        throws ExecutionException {
            try {
                IMap map = ProjectRepository.instance().newEntity( IMap.class, 
null );
                map.setLabel( mapName );
                map.setCRSCode( crsCode );
                parent.addMap( map );
            }
            catch (Throwable e) {
                throw new ExecutionException( e.getMessage(), e );
            }
            return Status.OK_STATUS;
        }

        public IStatus undo( IProgressMonitor monitor, IAdaptable info )
        throws ExecutionException {
            --- ??? ---
        }



> 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