> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Leo Simons
>
> well, maybe a metadata tag would work better:
>
> /** @@Scriptable */
> public class MyBlah { /* ... */ }
I have though about things like:
public class MyComponent implements ... {
/** @@Configurable ("./@numThreads") */
private final int numThreads;
}
<component role="..." class="MyComponent" numThreads="15"/>
So you use an XPath expression to have the container set the field
values.
The problem is when you have configurations like the one the ECM uses,
where you're not just setting field = value, but have to iterate over
child
configurations and create objects based on them:
<component role="..." class="MyComponent">
<subcomponent class="..."/>
<subcomponent class="..."/>
...
</component>
Maybe:
public class MyComponent implements ... {
/** @@SubComponents ("subcomponent") */
private final Collection subComponents;
}
But the thing here is that we're moving into the "too much magic" land.
What if only one of the subcomponents should be created. Or what if a
special handler is desired? Of course, we could have the @@SubComponent
mean that a Collection not of the actual components but of a component
descriptor or factory should be created, but try to formalize that
contract
for compile-time safety...
/LS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]