On Fri, 23 Sep 2011 14:04:34 +0800, Niclas Hedhman wrote:
Gang,

In 1.x, it seems that there were many (all?) cases where if no use()
was given in the builders, the construction of the object (transient?)
would fail. In 2.0, the current code will create a new object on the
fly if it can. For instance;

public class A
{
    @Uses B b;
}

public class B
{
   // default constructor
}

Then if one do;

    A anObject = module.newObject( A.class );

this will not fail. In 1.x it would, since no use() is given.


So the question is; Which one is the correct behavior? Explicit use()
declarations or on-the-fly-creation-if-possible?

I like the idea of on-the-fly-creation-if-possible. IMO it will ease the pain when working with graphs of objects. Anyway runtime still respect assembly
and visibility.

My 2 cents.

/Paul

--
Paul Merlin - eskatos.github.com

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

Reply via email to