On Wed, Dec 30, 2009 at 3:26 PM, Alex Shneyderman
<[email protected]> wrote:

So let's populate it a bit;

TransientBuilder<QrmTableMapping> bldr = ...;

return bldr.newInstance( new Intializer<QrmTableMapping> {
 void initialize(QrmTableMapping qtm)
 {
     qtm.name().set( "Habba" );
     qtm.something().set( new Date() );
 }
} );

And I am curious why this is 'better' than

TransientBuilder<QrmTableMapping> bldr = ...;
QrmTableMapping qtm = bldr.prototype();
qtm.name().set( "Habba" );
qtm.something().set( new Date() );
return bldr.newInstance();

Or if you like to be troublesome;

TransientBuilder<QrmTableMapping> bldr = ...;
new Intializer<QrmTableMapping> {
 void initialize(QrmTableMapping qtm)
 {
     qtm.name().set( "Habba" );
     qtm.something().set( new Date() );
 }
} ).initialize( bldr.prototype() );
return bldr.newInstance();



> I guess my usage pattern is a bit different than what was intended as
> I am trying to create a non-persistent graph of "entites" and have
> little use for the builder itself, as the matter of fact it is a throw
> away builder in most of my usage.

Not sure what you mean... The builders are a temporary artifact to be
disposed of after use.


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

Reply via email to