|
|
Re: Discovering transaction insertion point [message #26954 is a reply to message #26873] |
Thu, 02 March 2006 22:22 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Yes, you might be particularly interested to see how the example editor
installs custom property sources for the Properties view, to ensure that it
reads the model in read-only transactions. Perhaps this illustrates the
considerable extent to which the transaction protocol will permeate a UI
application ...
Christian
Vishy Ramaswamy wrote:
> Hi,
>
> Please refer to the transaction examples plugin within the transaction
> examples sdk or the transactions sdk. The plugin is
>
> org.eclipse.emf.workspace.examples.library.editor
>
> This plugin conatins an example editor
>
(org.eclipse.emf.workspace.examples.extlibrary.presentation. EXTLibraryEditor
> ) that demonstrates the integration of the TransactionalEditingDomain into
> the editor. This should be a good starting point
>
>
>
> Thanks
>
> Vishy
<snip>
|
|
|
|
Re: Discovering transaction insertion point [message #27110 is a reply to message #27032] |
Fri, 03 March 2006 22:25 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Ah, I see what you are looking for.
We do not yet have any means to assist in finding what code needs to be
"transactionalized" (if I may coin a word). We have given thought to some
potential strategies for inserting debug-time assertions into EMF and/or
generated metamodel code to check that the caller is in a transaction
context, and have mostly drawn blanks.
For now, we have only the obvious rule of thumb: whenever you're calling
code that *may* read from the model, do it in a read-only transaction.
Unless that code might also write to the model, in which case a read/write
transaction is required. The latter case is more tricky because the normal
way of creating a read/write transaction is either to execute a Command on
a CommandStack or an AbstractEMFOperation on an IOperationHistory. In
either of these cases, you want to be sure that the command/operation will
actually make some change, otherwise the Undo menu will have an ineffective
undo action on it!
Some kind of code-flow analysis tool might be able to indicate points in
your code from which the control graph will eventually enter the EMF APIs
that perform reads, but this is complicated by the sheer number of APIs in
EMF that read.
Cheers,
Christian
sf76 wrote:
> Dear all,
>
> i've already looked at the suggested plugin and, even not being an expert
> of emf, i think it is a great source of example/ideas about the
> integration of the emft component into an emf editor (and i've borrowed
> many of them).
>
> The point of my question was slightly different: is it there a way in
> order to discover all the places in an application that should be
> converted into an emft transaction?
>
> At the moment i'm converting a gef editor into a transactional one in
> order to evaluate emft capability. Since i don't own all of the code (i.e.
> gef cmd) i need to look manually at the points in which to insert emft
> constructs. Forgetting one gives an IllegalStateException throwed at
> runtime. Is it there a strategy or some kind of tricks in order to avoid
> such problems?
>
>
> Thanks again,
> Best regards
|
|
|
|
Re: Discovering transaction insertion point [message #571147 is a reply to message #26873] |
Thu, 02 March 2006 22:22 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Yes, you might be particularly interested to see how the example editor
installs custom property sources for the Properties view, to ensure that it
reads the model in read-only transactions. Perhaps this illustrates the
considerable extent to which the transaction protocol will permeate a UI
application ...
Christian
Vishy Ramaswamy wrote:
> Hi,
>
> Please refer to the transaction examples plugin within the transaction
> examples sdk or the transactions sdk. The plugin is
>
> org.eclipse.emf.workspace.examples.library.editor
>
> This plugin conatins an example editor
>
(org.eclipse.emf.workspace.examples.extlibrary.presentation. EXTLibraryEditor
> ) that demonstrates the integration of the TransactionalEditingDomain into
> the editor. This should be a good starting point
>
>
>
> Thanks
>
> Vishy
<snip>
|
|
|
|
Re: Discovering transaction insertion point [message #571326 is a reply to message #27032] |
Fri, 03 March 2006 22:25 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Ah, I see what you are looking for.
We do not yet have any means to assist in finding what code needs to be
"transactionalized" (if I may coin a word). We have given thought to some
potential strategies for inserting debug-time assertions into EMF and/or
generated metamodel code to check that the caller is in a transaction
context, and have mostly drawn blanks.
For now, we have only the obvious rule of thumb: whenever you're calling
code that *may* read from the model, do it in a read-only transaction.
Unless that code might also write to the model, in which case a read/write
transaction is required. The latter case is more tricky because the normal
way of creating a read/write transaction is either to execute a Command on
a CommandStack or an AbstractEMFOperation on an IOperationHistory. In
either of these cases, you want to be sure that the command/operation will
actually make some change, otherwise the Undo menu will have an ineffective
undo action on it!
Some kind of code-flow analysis tool might be able to indicate points in
your code from which the control graph will eventually enter the EMF APIs
that perform reads, but this is complicated by the sheer number of APIs in
EMF that read.
Cheers,
Christian
sf76 wrote:
> Dear all,
>
> i've already looked at the suggested plugin and, even not being an expert
> of emf, i think it is a great source of example/ideas about the
> integration of the emft component into an emf editor (and i've borrowed
> many of them).
>
> The point of my question was slightly different: is it there a way in
> order to discover all the places in an application that should be
> converted into an emft transaction?
>
> At the moment i'm converting a gef editor into a transactional one in
> order to evaluate emft capability. Since i don't own all of the code (i.e.
> gef cmd) i need to look manually at the points in which to insert emft
> constructs. Forgetting one gives an IllegalStateException throwed at
> runtime. Is it there a strategy or some kind of tricks in order to avoid
> such problems?
>
>
> Thanks again,
> Best regards
|
|
|
Powered by
FUDForum. Page generated in 0.04204 seconds