RE: [RT:A5] What are the _real_ concern areas?
"Berin Loritsch" <[email protected]>
| Newsgroups | gmane.comp.jakarta.avalon.apps.devel,gmane.comp.jakarta.avalon.devel |
|---|---|
| Message-ID | <[email protected]> |
> From: [email protected] [mailto:[email protected]]On Behalf Of Greg > > >>>>> "Berin" == Berin Loritsch <[email protected]> writes: > > Berin> What about merging Contextualizable, Configurable, and > Berin> Parameterizable? > > Berin> i.e. > > Berin> interface ConfigurationManager > Berin> { > Berin> Logger getLogger(); // can be its own interface... > Berin> Context getContext(); > Berin> Configuration getConfiguration(); > Berin> Properties getProperties(); // replace the > proprietary parameters. > Berin> } > > Currently it is very easy to extend AbstractLogEnabled to have logging > established. Can we achieve the same level of convenience with the new > approach? The best I could think of was calling > super.megaconfigure(configurationManager); > and have that do > m_logger = configurationManager.getLogger(); > > This is longer and more error prone. It's still the first stage. You would have something like this: class AbstractConfigurable implements Configurable { private m_configurationManager = null; public void configure( ConfigurationManager cm ) { m_configurationManager = cm; } protected Logger getLogger() { return m_configurationManager.getLogger(); } } Also note, that the Logger (AKA LogEnabled) can remain its own interface. In this case, we don't deviate a whole lot from the current Avalon: interface LogEnabled { void enableLogging( Logger logger ); } interface Configurable { void configure( ConfigurationManager cm ); } interface ConfigurationManager { Context getContext(); Configuration getConfiguration(); Properties getProperties(); } interface Serviceable { void service( ServiceManager sm ); } interface ServiceManager { Object lookup( String role ) throws ServiceException; boolean hasService( String role ) throws ServiceException; } interface Initializable { void initialize(); } interface Startable { void start(); void stop(); } interface Suspendable { void suspend(); void resume(); } interface ConfigurationChangeListener { void configurationChanged( ConfigurationChangeEvent ); } interface Disposable { void dispose(); }