Gang,
Quite often I come into the situation of the following code in
ConfigurationComposites;
@Optional
Property<String> something();
String something = conf.configuration().something().get();
if( something == null )
{
something = "some default";
conf.configuration().something().set( something );
}
And it just struck me; Why is that? Why can't this be handled behind
the scenes gracefully by Qi4j Runtime?
So,
@Optional( "some default" )
Property<String> something();
which not only makes the implementation code a lot cleaner, but also
communicate intent a lot better, instead of sticking it into Javadocs.
I am not entirely sure how the semantics with default settings from
assembly should be. Possibly the assembly should override the
programmatic declaration.
It should work equally well (I seldom have @Optional on those) of
method parameters.
WDYT?
Cheers
--
Niclas Hedhman, Software Developer
http://www.qi4j.org - New Energy for Java
I live here; http://tinyurl.com/2qq9er
I work here; http://tinyurl.com/2ymelc
I relax here; http://tinyurl.com/2cgsug
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev