Something like this:

TransientBuilder<QrmTableMapping> bldr = ...;

return bldr.newInstance( new Intializer<QrmTableMapping> {
  void initialize(QrmTableMapping qtm)
  {
      // init code here
  }
} );

Initializer is an interface that looks something like:

interface Initializer<T> {
  void init( T instance );
}

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.

On Wed, Dec 30, 2009 at 3:41 AM, Niclas Hedhman <[email protected]> wrote:
> On Wed, Dec 30, 2009 at 5:38 AM, Rickard Öberg <[email protected]> wrote:
>
>> One difference between the prototype and the real instance is that
>> non-optional properties may be null in the prototype, but not in the real
>> instance. Also, if you reuse the builder you'll get the same prototype
>> instance every time, so you don't want to return that from your code for
>> others to use (e.g. don't do "return bldrQTM.prototype();").
>
> Also, IIRC, the prototype is incomplete, your Mixin code is not there,
> just the pure state.
>
>
>> How would the initializing callback thing work? Can you provide a short
>> example?
>
> Yes, this will be interesting.
>
>
> 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
>

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to