| How to handle System Properties? [message #675751]
||Wed, 01 June 2011 07:54
| Stefan Liebig
Registered: July 2009
We recently had the case that a "accessor" method for a system property went into a class in riena.core which was not thought for this case - but it looked so good, everyone can see it, .. Well!?|
This usage unveils the need for a "visible" location for system properties. Before OSGi and proper modularization in mind there was often one central class (location) containing all the system properties.
But with OSGi and modularization this is a bad idea.
How about this?
Every bundle that gets "configured or controlled" by system properties has a non-internal class with "accessor" methods for the system properties. The classes have always the same (simple) name and are within the package with the same name as the bundles symbolic name, e.g. for riena.core it would be "org.eclipse.riena.core.SystemProperties" with "SystemProperties" as the common name for the class (may be there is a better name - I don't know).
+ all system property uses are easy to find
+ can be well documented
+ allows modularization
Powered by FUDForum
. Page generated in 0.01484 seconds