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?
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.
Michael
On Fri, September 26, 2008 12:46, Rickard Öberg wrote:
> Hey,
>
>
> With regard to services, as it is we require that services implement
> ServiceComposite. But, there are two sides to services, producing and
> consuming. I have no problem with requiring that in order to produce a
> Service in Qi4j it has to be a ServiceComposite, but as it is we cannot
> import external services from e.g. Jini, OSGi or Spring without having to
> wrap it in a ServiceComposite. I'm not sure there's a real need for it to
> be like this.
>
> As long as the service uses an interface we can create a proxy, which is
> the minimum requirement as far as I can see. If the service is an object
> then you have to create a ServiceComposite that uses Wrapper<servicetype>,
> but then it is still doable.
>
> Can anyone see a good reason to require that external services must
> implement ServiceComposite or be wrapped in a ServiceComposite? If not then
> I suggest that we change, possibly splitting up the current
> ModuleAssembly.addServices(ServiceComposite...) into two methods where
> one is for producers (addServices) and one is explicitly for importing
> external services
> (importServices(MyService.class).providedBy(SpringLookup.class)) or
> something like that. External services that are implemented in another Qi4j
> runtime would also then be imported using importServices() btw.
>
> Makes sense? Thoughts on this?
>
>
> /Rickard
>
>
> _______________________________________________
> 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