On Friday 23 January 2004 13:08, Leo Sutic wrote:

I have also spent some thinking of the "boilerplate" configuration you are so 
concerned about.

public class Radar 
{
    /** @configurable-property name="min-range" */
    private int minRange;
    /** @configurable-property name="max-range" */
    private int maxRange;

    public void configure (Configuration config)
        throws ConfigurationException 
    {
        ConfigurationUtility cu = new ConfigurationUtility();
        cu.poplute( this, config );
        if (minRange > maxRange) {
            throw new ConfigurationException ("min-range >
"max-range");
        }
    }
}

And the ConfigurationUtility class, would tie the XML elements to the private 
properties.
The ConfigUtility could even invoke more than one strategy (doc-tags, 
reflection, setters) accordingly.

It also removes it from being a container concern and has nothing to do with 
Framework.

Wouldn't something like this work fairly nicely?


Niclas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to