Hey,

I want to suggest a change to @Uses semantics. Basically, if I have the 
following object graph:
class A
{
   @Uses B b;
   @Uses C c;
}

class B
{
   @Uses C c;
}

class C
{}

then if I instantiate A, without using a builder, so no previous 
instances are provided, then the creation process should automatically 
create B and C, BUT B and A should refer to the same C, i.e. they don't 
get their own references.

This effectively allows me to create an object graph just by 
instantiating A, which would be nice. Right now, in my StreamFlow app, I 
am doing views (X extends JPanel) as @Services (as imported objects) 
pretty much only because I want the instances to be shared, but it feels 
reallyweird. I can't have many instances, for example. So, I would 
prefer to instead use @Uses for all injections, but then I have to 
ensure that within a graph I get the same instances.

Does this seem like an ok fix? I have already tried implementing it, and 
that worked well, so I know that it is doable. Is there any problem with it?

/Rickard

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

Reply via email to