Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » AbstractEMFOperation vs Command
AbstractEMFOperation vs Command [message #522416] Mon, 22 March 2010 15:21 Go to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

In order to modify EMF resources, I can use AbstractEMFOperation or org.eclipse.emf.common.Command

I'm wondering:
- what is the real difference between each of us?
- In which case should I use one instead of another?

It seems that Command are registered with WorkspaceCommandStackImpl$1 context. So will it be in-memory during all time that the program is running? How can I set a limit to this stack context?

Any hints or references on these class are welcomed.

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: AbstractEMFOperation vs Command [message #522472 is a reply to message #522416] Mon, 22 March 2010 17:49 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Aurelien,

I shall start by assuming that you already need the concurrency,
validation, and rollback support provided by the EMF Transaction
framework, because this is the only context in which
AbstractEMFOperation makes sense.

Given that, the primary distinction between AbstractEMFOperation and
Command is in integration with the Eclipse Workbench's
IOperationHistory. This enables a more complex "undo stack" model than
the single linear stack of the EMF CommandStack. The IUndoContexts that
tag IUndoableOperations project a single undo history history onto any
number of intersecting "undo stacks." An editor presents one of these
stacks in its Undo/Redo menu actions by selecting its contexts.

One motivation for integrating with the operation history is
demonstrated by GMF: the ability to let multiple editor instances work
on a shared model (in a shared TransactionalEditingDomain), each
maintaining their own view of the undo history, but still accounting for
dependent changes made in the other editors.

HTH,

Christian

On 22/03/10 11:21 AM, Aurelien Pupier wrote:
> Hi,
>
> In order to modify EMF resources, I can use AbstractEMFOperation or
> org.eclipse.emf.common.Command
>
> I'm wondering:
> - what is the real difference between each of us?
> - In which case should I use one instead of another?
>
> It seems that Command are registered with WorkspaceCommandStackImpl$1
> context. So will it be in-memory during all time that the program is
> running? How can I set a limit to this stack context?
>
> Any hints or references on these class are welcomed.
>
> Regards,
Previous Topic:EMF validation: provide client data for validation listener from inside a constraint
Next Topic:[CDO] How to programmatically add authentication negotiators
Goto Forum:
  


Current Time: Fri Apr 26 15:45:13 GMT 2024

Powered by FUDForum. Page generated in 0.02726 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top