Michael Hunger wrote:
> We had this discussion on the geek cruise.
> 
> There the question occurred if any of the qi4j specific *Composite
> interfaces must be present at the implementing client code.
> 
> Because when adding the stuff to the assembly via addXXXX() we could just
> add XXXComposite to this objects declaration.
> 
> so, addEntity(MyEntity.class)
> would automatically add EntityComposite to the list of interfaces that
> MyEntity declares.
> 
> Same goes for services and other composites.
> 
> WDYT?

Well, it is tempting, but there are some things that needs to be fixed 
at the same time. First of all, it is a start down the slippery slope of 
adding things which is not explicitly there in the declaration. Also, 
the PropertyMixin is declared on the Composite, so the question is how 
the rule for applying the @Mixins annotation on Composite must change 
due to implicitly added interfaces.

Also, some methods right now require classes that extend this or that 
base interface. They would then become "Class<?>" or "Object" instead, 
which I'm not sure I like. It becomes more difficult to require things 
from an object.

Hm... like I said, I understand that it is tempting (and we *have* had 
this discussion before), but if we do so these things must be resolved 
first.

> And having implementations/instances provided via configuration is an
> additional benefit for that. So we could slurp in SpringConfigs or OSGI or
> whatever Webservice Endpoints are out there provided they implement the
> given base interface of the service.
> 
> addService(MyService.class).metaInfo(springProvided("beanName"))
> 
> then the springProvided could produce a proxy/indirection for the spring
> lookup which is used when accessing/creating the service via
> ServiceFactoryInstance.

I would suggest, again, that there is a difference between declaring an 
active instance to be executed IN the Qi4j application, and importing an 
external service. For example, "instantiateOnStartup" only makes sense 
for instances that are actually running in Qi4j, and not for imported 
services.

/Rickard


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

Reply via email to