Setting up execution order of plugins on startup [message #270267] |
Tue, 14 April 2009 05:46  |
Eclipse User |
|
|
|
Hi,
I have 2 plugins (say plugin1 nd plugin2) for Eclipse that has extension
points for org.eclipse.ui.startup and implements IStartup. Now when I
start my eclipse both of these plugins gets loaded and do whatever I have
implemented in the earlyStartup() method.
I observed that sometimes implementation of plugin1 happens before the
implementation of plugin2 is triggered and sometimes the order is reversed.
So, my question is how can I set the execution/loading of plugins order so
that every time plugin1 gets loaded first rather than plugin2?
Thanks in advance.
|
|
|
|
Re: Setting up execution order of plugins on startup [message #270291 is a reply to message #270267] |
Tue, 14 April 2009 14:24  |
Eclipse User |
|
|
|
"ankit baphna" <anki_daiict@yahoo.com> wrote in message
news:5132ce46001b93ec7f258ad91337df12$1@www.eclipse.org...
> Hi,
>
> I have 2 plugins (say plugin1 nd plugin2) for Eclipse that has extension
> points for org.eclipse.ui.startup and implements IStartup. Now when I
> start my eclipse both of these plugins gets loaded and do whatever I have
> implemented in the earlyStartup() method. I observed that sometimes
> implementation of plugin1 happens before the implementation of plugin2 is
> triggered and sometimes the order is reversed.
>
> So, my question is how can I set the execution/loading of plugins order so
> that every time plugin1 gets loaded first rather than plugin2?
If the order of startup matters, you may be trying to do too much in your
startup methods.
Instead, try to defer meaningful initialization until when the functionality
is actually needed.
Use plugin dependencies to provide compilation dependencies (e.g., plugin B
references a class defined in plugin A). Use extensions and extension
points to provide runtime dependencies (e.g., plugin A defines an interface
X, and exposes an extension point; plugin B depends on A, extends the
extension point, and provides implementation class Y at runtime).
There are some special cases where those rules are not sufficient, but they
cover 95% of the cases. If those rules aren't attainable in your case,
carefully examine your design to see if it has to be so. You may be making
your life harder than it needs to be.
|
|
|
Powered by
FUDForum. Page generated in 0.10392 seconds