celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ferry Huberts <maili...@hupie.com>
Subject Re: Celix and Declarative Services
Date Tue, 26 Jun 2012 12:59:45 GMT

On 26-06-12 14:28, Alexander Broekhuis wrote:
> Hi all,
> After Ferry's question I've been looking a little at the OSGi Declarative
> Services spec, and I think most of it can be realized using the current
> Celix implementation.

that would be absolutely awesome!

> One of the problems I've seen so far is related to service registration.
> Using Java a service is an interface, and through reflection and the
> implementation of the component, this interface can be registered as a
> service by the DS implementation.
> In Celix a service is a struct with function pointers, which has to be
> instantiated by the user. It is not possible to do this dynamically, the DS
> implementation does not know the functions of the component etc.
> A simple solution would be to use an additional function in the component
> in which the service struct is created. Downside of this is, that there is
> no strict separation of component and framework code....

Why not? (maybe I'm missing something)

IMHO it's just a method extra on the 'activator' interface (or an extra 
'special' interface).

Right now you have start/stop/etc there. You'd just be adding something 
like 'instantiateServiceRegistrationStruct' there, wouldn't you?

Seeing as it's C, for me that'd be ok.

A disadvantage would be that you'd probably still have to implement that 
function even if you're not using DS, right?

> Perhaps someone else has some ideas how this can be solved differently....

Ferry Huberts

View raw message