2009/2/4 Guillaume Sauthier <[email protected]>

> Clement Escoffier a écrit :
>
>> Hi,
>> On 03.02.2009, at 16:40, Stuart McCulloch wrote:
>>
>>  2009/2/3 Rob Walker <[email protected]>
>>>
>>>  The servicebinder model has served us very well and still does. I note
>>>> though that there are perhaps newer approaches such as Declarative
>>>> Services
>>>> and iPojo. Very interested in views on:
>>>>
>>>>  * benefits of moving from servicebinder (especially any real
>>>>   experiences from others who have done this)
>>>>  * pros and cons of either DS or iPojo as the model to move to
>>>>
>>>>
>>> interesting, Karl and I were just chatting about this...
>>>
>>> iPOJO provides a really comprehensive component model, where you
>>> can add almost any sort of behaviour using handlers - the downside in
>>> my opinion is that it requires you to instrument your bundles in the
>>> build
>>> phase - these bundles cannot then be used without iPOJO
>>>
>>
>> The instrumentation is made in a way that you don't need iPOJO to use a
>> manipulated class (see
>> http://felix.apache.org/site/dive-into-the-ipojo-manipulation-depths.html).
>> The only downside, is that the iPOJO management will not happen.
>>
>>
> Just to be 100% clear, does this means that your instrumented class can be
> reused outside of OSGi ?
> I mean,will the following pseudo code work outside of OSGi, with the
> manipulated classes ?
>
> MyComponent mc = new MyComponent();
> mc.setProperty("hello");
> mc.doSomething();
>

based on Clement's detailed description at:

   http://felix.apache.org/site/dive-into-the-ipojo-manipulation-depths.html

the answer is yes, but there seems to be a type dependency on
InstanceManager
which means that (in my limited experience) you need the iPOJO bundle
installed
alongside your enhanced bundle to provide certain packages - this is just so
the
bundle resolves, it's not actually used at runtime. If you construct
instances directly
the iPOJO management fields default to null and the instance reverts to its
original
behaviour :)

so yes, you can re-use the manipulated classes outside of the iPOJO
container
(very similar to how you can re-use Guice annotated classes in other
containers,
 because the @Inject annotation doesn't introduce a mandatory dependency ;)

Thanks
> --Guillaume
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

-- 
Cheers, Stuart

Reply via email to