Skip to main content



      Home
Home » Modeling » EMF » [CDO] Editing lazy loaded objects
[CDO] Editing lazy loaded objects [message #905358] Thu, 30 August 2012 04:22 Go to next message
Eclipse UserFriend
Hi,

I load a PART of one or more containment graphs. Then I want to edit the objects making use of EMFs mechanisms for undo/redo and maybe even using EditingDomains together with existing or custom editors.

Now all implementations of ChangeRecorders and EditingDomains that I have found uses Adapters inherited from EcontentAdapter to adapt the object graph. The self adapting process of EcontentAdapter reads the whole containment graph from the database. This is not doable for my models due to time and memory constraints.

I have been looking for examples of lazy loading editors but all I found, for instance CDO editors and DAWN, loads everything every time.

Where can I find an example of how to create a ChangeRecorder and an EditingDomain that uses lazy adating/loading?

I thought I would change the behavior of some EditingDomain and ChangeRecorder implementation to make it use CDOLazyContentAdapter instead. It turned out to be really hard. My first approach was to subclass stuff to achieve this, but I couldn't find a way to do that for any EditingDomain or ChangeRecorder due to the inheritance tree and private resources.

I needed to do some ugly hacking into (creating my own versions of) ChangeCommand, ChangeRecorder and BasicChangeRecorder in order to get undo/redo to work without loading unwanted objects. It works but is not a good solution since:
- I do not know the full consequences of the hacking I have done.
- It makes my code vulnerable to changes in the framework.
- I still haven't got a working EditingDomain with lazy adapting.

Has someone else done this?

Regards
///Anders




Re: [CDO] Editing lazy loaded objects [message #905362 is a reply to message #905358] Thu, 30 August 2012 04:29 Go to previous messageGo to next message
Eclipse UserFriend
Am 30.08.2012 10:22, schrieb Anders Jönsson:
> Hi,
>
> I load a PART of one or more containment graphs. Then I want to edit the objects making use of EMFs mechanisms for
> undo/redo and maybe even using EditingDomains together with existing or custom editors.
>
> Now all implementations of ChangeRecorders and EditingDomains that I have found uses Adapters inherited from
> EcontentAdapter to adapt the object graph. The self adapting process of EcontentAdapter reads the whole containment
> graph from the database. This is not doable for my models due to time and memory constraints.
Have you already tried out CDOLazyContentAdapter?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Editing lazy loaded objects [message #905368 is a reply to message #905362] Thu, 30 August 2012 04:48 Go to previous messageGo to next message
Eclipse UserFriend
>Have you already tried out CDOLazyContentAdapter?
Yes, the changes I did to ChangeCommand, ChangeRecorder and BasicChangeRecorder was to make them use CDOLazyContentAdapter. That was what got complicated (i needed to make my own versions of all three classes) and made me feel there might be another solution out there. Especially since this feels like a generic use case, doesn't it?
Plus I still don't know if I will ever manage to create a lazy adapting EditingDomain.

///Anders
Re: [CDO] Editing lazy loaded objects [message #905398 is a reply to message #905368] Thu, 30 August 2012 06:04 Go to previous messageGo to next message
Eclipse UserFriend
Am 30.08.2012 10:48, schrieb Anders Jönsson:
>> Have you already tried out CDOLazyContentAdapter?
> Yes, the changes I did to ChangeCommand, ChangeRecorder and BasicChangeRecorder was to make them use
> CDOLazyContentAdapter. That was what got complicated (i needed to make my own versions of all three classes) and made
> me feel there might be another solution out there. Especially since this feels like a generic use case, doesn't it?
> Plus I still don't know if I will ever manage to create a lazy adapting EditingDomain.
That reminds me to this bugzilla:

323792: Provide CDO-based TransactionalEditingDomain
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323792

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Re: [CDO] Editing lazy loaded objects [message #905431 is a reply to message #905398] Thu, 30 August 2012 07:22 Go to previous messageGo to next message
Eclipse UserFriend
Eike,
That bugzilla does discuss the same issues. But it discusses a lot of issues and seems unfocused to me. Do you think it would be appropriate to file a new bug?
Something like:
"Lazy adapting EditingDomain"
with the purpose to provide a plain ChangeRecorder and an EditingDomain that uses CDOLazyContentAdapter. This should make undo/redo work in a typical CDO setting where only a part of an object graph is loaded. It should also make EMF based editors work in the same setting.

///Anders
Re: [CDO] Editing lazy loaded objects [message #905581 is a reply to message #905431] Thu, 30 August 2012 13:14 Go to previous messageGo to next message
Eclipse UserFriend
Am 30.08.2012 13:23, schrieb Anders Jönsson:
> Eike,
> That bugzilla does discuss the same issues. But it discusses a lot of issues and seems unfocused to me. Do you think
> it would be appropriate to file a new bug?
Yes ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



> Something like:
> "Lazy adapting EditingDomain"
> with the purpose to provide a plain ChangeRecorder and an EditingDomain that uses CDOLazyContentAdapter. This should
> make undo/redo work in a typical CDO setting where only a part of an object graph is loaded. It should also make EMF
> based editors work in the same setting.
>
> ///Anders
>
Re: [CDO] Editing lazy loaded objects [message #908076 is a reply to message #905581] Tue, 04 September 2012 12:50 Go to previous message
Eclipse UserFriend
Now there is:
Bug 388770 - Provide a lazy adapting ChangeRecorder

///Anders
Previous Topic:how to access emfmodel in xmi
Next Topic:getOldValue call on Notification from validationOccurred returns null
Goto Forum:
  


Current Time: Sun Nov 09 02:53:48 EST 2025

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

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

Back to the top