Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Activator class - newbie question
Activator class - newbie question [message #459668] Wed, 06 December 2006 02:53 Go to next message
Eclipse UserFriend
Originally posted by: guefeld.spammerslammer.com

Hello NG,

Is it a wise decision to let reside references to application global data in
the application's Activator class?
Or is it better to have separate singleton objects for this purpose?

For example configuration data, database connections, data to be shared
between Editor and View class descendants...

I am quite new to RCP and Java programming.

Thank you for your advice

G
Re: Activator class - newbie question [message #459678 is a reply to message #459668] Wed, 06 December 2006 07:27 Go to previous message
Eclipse UserFriend
If you are using singletons, then a common pattern in eclipse is to
provide them through your Activator. i.e. DatabaseConnectionManager,
ContextManager, ConfigurationManager.

The common pattern is to get your Activator instance and lazily
instantiate the singletons as you need them.

MyPlugin.getDefault().getContextManager()

For sharing data between views and editors, there are actually a couple
of options. The Selection Service is one common method. Also having a
view register an IPartListener2 and checking for your specific type of
editors as they are activated (that's how the Outline View works).

But your singleton DocumentProvider could live in your plugin instance.


Later,
PW
Previous Topic:Compile errors after setting dependencies between Rcp and NON-Rcp projects.
Next Topic:saving init data
Goto Forum:
  


Current Time: Wed Mar 26 02:03:41 EDT 2025

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

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

Back to the top