sharing objects in an RCP application [message #447779] |
Sat, 15 April 2006 20:47 |
Eclipse User |
|
|
|
Originally posted by: admin.chatelp.org
Hi there !
I'm looking for a "best practice" to share objects between different
parts of my RCP application. For instance, i would like to:
1) hook to the startup of the application (should i use the lifecyle
methods provided by the workbench advisor, i read somewhere that it's
not a good idea)
2) When notified of the application startup, initialize some instances
that need to be accessed by different parts of my application
3) Be able to access the 'shared' instances anywhere in my code.
I see to 2 different possibilities, none of which seams acceptable to me:
The first would be to create the shared objects in the workbench
advisor and then propagate them using method calls from advisors to
advisors, then to my code.
The second, I'm currently using, is by initializing them in a viewer,
and accessing them with ....getActivePage().findView(MyViewer.ID) and
black magic in order to access the view and then the field
corresponding to my shared instance.
Any suggestions ?
Thanks,
Pierre
|
|
|
Powered by
FUDForum. Page generated in 0.03123 seconds