[loom] [dna] Properties in component configurations

Ryan Hoegg <[email protected]>
Newsgroups gmane.comp.java.jcontainer.interest
Message-ID <[email protected]>
Hello,

Wanted to get your thoughts on using properties in component 
configuration like in maven / jelly.

My first thought is that it should be done transparently by the 
container, but I don't know if that should somehow be mentioned in DNA.  
Thoughts?

It could also be done by another block, ConfigPropertiesResolutionBlock, 
and then declared as a dependency by any component that wants to use it. 
Then, the component would do something like this:

/**
* @dna dependency 
name="org.jcomponent.propertiesresolver.PropertiesResolver"
*/
public void compose(ResourceLocator locator) throws MissingResourceException
{
     this.propertiesResolver = 
locator.lookup("org.jcomponent.propertiesresolver.PropertiesResolver");
}

public void configure(Configuration configuration) throws 
ConfigurationException
{
    Configuration processedConfig = 
propertiesResolver.resolveProperties(configuration);

    // do stuff with processedConfig instead of configuration
}

Which way sounds good to you?

--
Ryan Hoegg
ISIS Networks
http://www.isisnetworks.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.