Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Global AdapterFactory vs one per each EditingDomain
icon3.gif  Global AdapterFactory vs one per each EditingDomain [message #904383] Tue, 28 August 2012 06:59 Go to next message
Sorin Fagateanu is currently offline Sorin Fagateanu
Messages: 46
Registered: July 2009
Member
Hello,

What are the differences of using the same instance of an AdapterFactory with all loaded EditingDomains over using an AdapterFactory per each loaded EditingDomain?

The first difference that comes to my mind is that when using a global AdapterFactory, only a single set of item providers exist whereas using one per each EditingDomain would result in a set of item providers for each domain.

Is the performance (memory, speed) of the overall EMF mechanism affected in any way by using a global instance?

What are the other important/notable differences?

Thank you in advance,
Sorin.

[Updated on: Tue, 28 August 2012 07:02]

Report message to a moderator

Re: Global AdapterFactory vs one per each EditingDomain [message #904415 is a reply to message #904383] Tue, 28 August 2012 07:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26013
Registered: July 2009
Senior Member
Sorin,

Comments below.

On 28/08/2012 12:59 PM, Sorin Fagateanu wrote:
> Hello,
>
> What are the differences of using the same instance of an
> AdapterFactory with all loaded EditingDomains over using an
> AdapterFactory per each loaded EditingDomain?
Which adapter factory specifically are you referring to?
> The first difference that comes to my mind is that when using a global
> AdapterFactory, only a single set of item providers exist whereas
> using one per each EditingDomain would result in a set of item
> providers for each domain.
So item provider adapters... If you have the adapter factory global,
you also have the issue of the adapters holding references to the
objects loaded by the editor after the editor closes. This will result
in a huge memory leak.
>
> Is the performance (memory, speed) of the overall EMF mechanism
> affected in any way by using a global instance?
Ensuring that such global adapters don't hang onto the objects is a
significant concern. You'd need to call unload on all the resources in
the editor to ensure that their adapter lists are clear and hence that
the adapters remove their references to them.
> What are there other important/notable differences?
I think there's very little to be gained by keeping the item provider
adapters globally. They're generally stateless singletons so don't take
up much space on their own.
>
> Thank you in advance,
> Sorin.
Re: Global AdapterFactory vs one per each EditingDomain [message #905341 is a reply to message #904383] Thu, 30 August 2012 03:52 Go to previous message
Sorin Fagateanu is currently offline Sorin Fagateanu
Messages: 46
Registered: July 2009
Member
Hello Ed,

Thank you for your time and answers.

I was referring to the adapterFactory of the AdaterFactoryEditingDomain and I wanted to be sure that the way I understand adapter factories and item providers is correct.

Sorin.
Previous Topic:Distinct ItemProvider for different view
Next Topic:[CDO] Finding detached objects
Goto Forum:
  


Current Time: Thu Aug 28 23:29:14 EDT 2014

Powered by FUDForum. Page generated in 0.01735 seconds