Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » When is a AdapterFactory loaded?
When is a AdapterFactory loaded? [message #480601] Mon, 17 August 2009 20:01 Go to next message
Christoph Höger is currently offline Christoph Höger
Messages: 40
Registered: July 2009
Member
Hi,

I am using a custom AdapterFactory to map IResources to my custom model.
That works fine - except for the startup, the factory is simply not
asked. Is that normal or is there a way to load that factory earlier?

regards

Christoph
Re: When is a AdapterFactory loaded? [message #480727 is a reply to message #480601] Tue, 18 August 2009 10:34 Go to previous messageGo to next message
Philipp Kursawe is currently offline Philipp Kursawe
Messages: 135
Registered: July 2009
Senior Member
Christoph Höger wrote:
> Hi,
>
> I am using a custom AdapterFactory to map IResources to my custom model.
> That works fine - except for the startup, the factory is simply not
> asked. Is that normal or is there a way to load that factory earlier?
If you created the AdapterFactory using the extension point it is only
instantiated when the plugin is active.
This has bitten many others before. Why the behaviour is like that - I
forgot. Paul Webster might know.
Make sure the bundle is started or use Declarative Service to add a
programmatic adapter factory. I almost never use the declarative adapter
factories anymore. Too much pain.

Phil
Re: When is a AdapterFactory loaded? [message #481392 is a reply to message #480727] Thu, 20 August 2009 18:57 Go to previous messageGo to next message
Christoph Höger is currently offline Christoph Höger
Messages: 40
Registered: July 2009
Member
Am 18.08.2009 12:34, schrieb Philipp Kursawe:
> Christoph Höger wrote:
>> Hi,
>>
>> I am using a custom AdapterFactory to map IResources to my custom
>> model. That works fine - except for the startup, the factory is simply
>> not asked. Is that normal or is there a way to load that factory earlier?
> If you created the AdapterFactory using the extension point it is only
> instantiated when the plugin is active.
> This has bitten many others before. Why the behaviour is like that - I
> forgot. Paul Webster might know.
> Make sure the bundle is started or use Declarative Service to add a
> programmatic adapter factory. I almost never use the declarative adapter
> factories anymore. Too much pain.

Ah. Thanks. I'll keep that in mind (worked around for now).
Re: When is a AdapterFactory loaded? [message #483352 is a reply to message #480727] Tue, 01 September 2009 09:54 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
Philipp Kursawe wrote:
> Christoph Höger wrote:
>> Hi,
>>
>> I am using a custom AdapterFactory to map IResources to my custom
>> model. That works fine - except for the startup, the factory is simply
>> not asked. Is that normal or is there a way to load that factory earlier?
> If you created the AdapterFactory using the extension point it is only
> instantiated when the plugin is active.
> This has bitten many others before. Why the behaviour is like that - I
> forgot. Paul Webster might know.
> Make sure the bundle is started or use Declarative Service to add a
> programmatic adapter factory. I almost never use the declarative adapter
> factories anymore. Too much pain.

I agree regarding the pain. There is a very old issue (#82973) that
one might consider to vote for - I still don't loose the hope ;-)

IMO it would be the right direction to go, if ext.pt.
org.eclipse.core.runtime.adapters would provide an optional boolean
flag (e.g. "force") which could be set to true to ensure that -
if not loaded - the corresponding contributing plug-in will be loaded,
similar to the effect of IAdapterManager#loadAdapter.

I don't understand the hesitations to support this request. It would
be perfectly backward compatible (the default value would be false).

Greetings from Bremen,

Daniel Krügler
Re: When is a AdapterFactory loaded? [message #483381 is a reply to message #483352] Tue, 01 September 2009 12:17 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Daniel Krügler wrote on Tue, 01 September 2009 05:54
I don't understand the hesitations to support this request. It would
be perfectly backward compatible (the default value would be false).



The reason centers on the 2 dev groups, I'll call them producers and consumers Smile

Producers want their stuff to work right, and in the shortest amount of code. That's why people still instantiate IActions (an anonymous inner class where you can set the label/icon, enabled state, and the execution code). Yes, it's tight coupling, but it's easy to do.

Consumers (especially large ones) want to control when things are loaded (I heard of one large consumer where a tweak to load a subcomponent on first access instead of on startup shaved 11 seconds off of the startup time).

If the producer gets to say "I'll always load so I'm 100% correct" the consumer can never say "well, I'll defer that until I need it".

Right now the workbench gives some powers to consumers and some to producers.

But that's the reason why default behaviour like that is *not* added without lots of discussion and dissension ... the goals are actually at odds, and the part of eclipse that's the framework (and has to support both cases) needs a lot of careful consideration.

PW


Previous Topic:Perspective change prompt
Next Topic:Different Behaviour between Platforms hide shell
Goto Forum:
  


Current Time: Tue Sep 23 20:37:04 GMT 2014

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

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