On Monday 27 October 2003 03:20, Leo Simons wrote:
> >> 1. I think KernelParameters should go into a seperate package that
> >> other packages (such as kernel) depend on. This will make it easier
> >> when creating the bootstrap process.
>
> disagree! Recognize the tight coupling between config and component and
> reflect it :D

Hmmmm.... Now you got me thinking.
Perhaps this has been brought up before... Maybe it belong more on Pico/Nano 
mailing lists...

public class MyComponent
{

        public MyComponent( MyComponentConfig config )
        {
                // handle config
        }
}

public interface MyComponentConfig 
{
        String getName();
        int getSomeValue();
        AnotherBean getSomeBean();
}

<configuration type="org.hedhman.niclas.MyComponentConfig">
  <Name>MyFabulousComponent</Name>
  <SomeValue>15</SomeValue>
  <AnotherBean />
</configuration>

It is pretty easy to parse the XML and create a dynamic proxy for the Config 
object.
And could also have some nice construction semantics for JavaBeans, such as
  <AnotherBean type="org.hedhman.niclas.AnotherBean" >
    <Level>4</Level>
    <TimeSpan>7200</TimeSpan>
  </AnotherBean>
Although this is slightly different issue.


I feel really good about coded Config objects instead of the runtime 
interpreted ones.


Niclas



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

Reply via email to