You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Matthias Neubert <su...@onlinehome.de> on 2009/09/25 11:58:46 UTC

Best practise question

Hello,

this time I have got an question about a best practise regarding Felix  
and iPOJO

BundleA contains only a Package with an Interface, which it exports.  
It imports another Package with Interface from Interface-BundleB. 
(which is needed for describing BundleA's Interface)

Exp.:

BundleB:
Export-Package: org.bundleB.ServiceB

BundleA:
Import-Package: org.bundleB.ServiceB
Export-Package: net.bundleA.ServiceA

An Implementation Bundle of BundleA's Interface (BundleAImpl) imports  
BundleA's Packages for implementing it, and so also has to import  
BundleB's Package:

BundleAImpl:
Import-Package: org.bundleB.ServiceB, net.bundleA.ServiceA


My Intension is, to be shure that the bundles  BundleA and BundleAImpl  
allways import the same package from same BundleB (to avoid e.g.  
version conflicts)

My think it must be something like BundleA is reexporting Package of  
BundleB and BundleAImpl shuld be forced to import BundleB-Package over  
BundleA.

Question: are there any best practises to achieve this?


regards
Matthias

  

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Best practise question

Posted by Matthias Neubert <su...@onlinehome.de>.
Hi,

In my Case BundleAImpl does only implement Service described in  
BundleA's Package, for which it imports it.
The Package of BundleB contains Interfaces which defines Types and one  
Service which are used in Interface of BundleA and
in BundleAImpl
A BundleBImpl implements BundleB's Interfaces.

So I want to make shure, that BundleA and BundleAImpl are wired to the  
same BundleB-Interfaces.
I thought that reexporting the imported BundleB in BundleA and  
importing both into BundlaAImpl using BundleA
would do the trick.

I wanted to be a bit lazy, but now I guess its only making sense to  
use (the same) Version-constraints in BundleA and in BundleAImpl

please tell me if I'm on the right way.

regards
Matthias




Am 25.09.2009 um 21:35 schrieb Felix Meschberger:

> Hi,
>
> Matthias Neubert schrieb:
>> Hello,
>>
>> thanks for your reply:
>>
>>> BundleA:
>>> Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4)
>>> Export-Package: net.bundleA.ServiceA
>>
>>
>> -> does Bundle  "BundleAImpl" Import then look like this:
>> Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4),
>> net.bundleA.ServiceA
>
> No, I don't think so. It suffices it to say version=1.2.3 (or whatever
> is appropriate for BundleAImpl). The framework should calculate the
> wiring so that versions match.
>
> Of course, if BundleAImpl implements an interface which comes from
> BundleB, you will have to take extra care with the bundleB package
> import and might even have to specify the same import version  
> restriction.
>
> Regards
> Felix
>
>>
>> ?
>>
>> This would have the drawback that I have to know for building
>> BundleAImpl which version
>> is imported by  by BundleA. This is somehow dangerous. I'd like to  
>> have
>> this automated.
>>
>> Is there any possebility to have this automatically?
>>
>> regards
>> Matthias
>>
>>
>> Am 25.09.2009 um 20:29 schrieb Felix Meschberger:
>>
>>> Hi,
>>>
>>> Matthias Neubert schrieb:
>>>> Hello,
>>>>
>>>> this time I have got an question about a best practise regarding  
>>>> Felix
>>>> and iPOJO
>>>>
>>>> BundleA contains only a Package with an Interface, which it  
>>>> exports. It
>>>> imports another Package with Interface from Interface-BundleB. 
>>>> (which is
>>>> needed for describing BundleA's Interface)
>>>>
>>>> Exp.:
>>>>
>>>> BundleB:
>>>> Export-Package: org.bundleB.ServiceB
>>>>
>>>> BundleA:
>>>> Import-Package: org.bundleB.ServiceB
>>>> Export-Package: net.bundleA.ServiceA
>>>>
>>>> An Implementation Bundle of BundleA's Interface (BundleAImpl)  
>>>> imports
>>>> BundleA's Packages for implementing it, and so also has to import
>>>> BundleB's Package:
>>>>
>>>> BundleAImpl:
>>>> Import-Package: org.bundleB.ServiceB, net.bundleA.ServiceA
>>>>
>>>>
>>>> My Intension is, to be shure that the bundles  BundleA and  
>>>> BundleAImpl
>>>> allways import the same package from same BundleB (to avoid e.g.  
>>>> version
>>>> conflicts)
>>>>
>>>> My think it must be something like BundleA is reexporting Package  
>>>> of
>>>> BundleB and BundleAImpl shuld be forced to import BundleB-Package  
>>>> over
>>>> BundleA.
>>>>
>>>> Question: are there any best practises to achieve this?
>>>
>>> I would not re-export bundleB package from BundleA. Rather I would  
>>> tye
>>> the version used by BundleA closes to the version exported by  
>>> BundleB
>>> and used by BundleA, e.g.:
>>>
>>> BundleB:
>>> Export-Package: org.bundleB.ServiceB; version=1.2.3
>>>
>>> BundleA:
>>> Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4)
>>> Export-Package: net.bundleA.ServiceA
>>>
>>> I think this should do the trick.
>>> Regards
>>> Felix
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Best practise question

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Matthias Neubert schrieb:
> Hello,
> 
> thanks for your reply:
> 
>> BundleA:
>> Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4)
>> Export-Package: net.bundleA.ServiceA
> 
> 
> -> does Bundle  "BundleAImpl" Import then look like this:
>  Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4),
> net.bundleA.ServiceA

No, I don't think so. It suffices it to say version=1.2.3 (or whatever
is appropriate for BundleAImpl). The framework should calculate the
wiring so that versions match.

Of course, if BundleAImpl implements an interface which comes from
BundleB, you will have to take extra care with the bundleB package
import and might even have to specify the same import version restriction.

Regards
Felix

> 
> ?
> 
> This would have the drawback that I have to know for building
> BundleAImpl which version
> is imported by  by BundleA. This is somehow dangerous. I'd like to have
> this automated.
> 
> Is there any possebility to have this automatically?
> 
> regards
> Matthias
> 
> 
> Am 25.09.2009 um 20:29 schrieb Felix Meschberger:
> 
>> Hi,
>>
>> Matthias Neubert schrieb:
>>> Hello,
>>>
>>> this time I have got an question about a best practise regarding Felix
>>> and iPOJO
>>>
>>> BundleA contains only a Package with an Interface, which it exports. It
>>> imports another Package with Interface from Interface-BundleB.(which is
>>> needed for describing BundleA's Interface)
>>>
>>> Exp.:
>>>
>>> BundleB:
>>> Export-Package: org.bundleB.ServiceB
>>>
>>> BundleA:
>>> Import-Package: org.bundleB.ServiceB
>>> Export-Package: net.bundleA.ServiceA
>>>
>>> An Implementation Bundle of BundleA's Interface (BundleAImpl) imports
>>> BundleA's Packages for implementing it, and so also has to import
>>> BundleB's Package:
>>>
>>> BundleAImpl:
>>> Import-Package: org.bundleB.ServiceB, net.bundleA.ServiceA
>>>
>>>
>>> My Intension is, to be shure that the bundles  BundleA and BundleAImpl
>>> allways import the same package from same BundleB (to avoid e.g. version
>>> conflicts)
>>>
>>> My think it must be something like BundleA is reexporting Package of
>>> BundleB and BundleAImpl shuld be forced to import BundleB-Package over
>>> BundleA.
>>>
>>> Question: are there any best practises to achieve this?
>>
>> I would not re-export bundleB package from BundleA. Rather I would tye
>> the version used by BundleA closes to the version exported by BundleB
>> and used by BundleA, e.g.:
>>
>> BundleB:
>> Export-Package: org.bundleB.ServiceB; version=1.2.3
>>
>> BundleA:
>> Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4)
>> Export-Package: net.bundleA.ServiceA
>>
>> I think this should do the trick.
>> Regards
>> Felix
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Best practise question

Posted by Matthias Neubert <su...@onlinehome.de>.
Hello,

thanks for your reply:

> BundleA:
> Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4)
> Export-Package: net.bundleA.ServiceA


-> does Bundle  "BundleAImpl" Import then look like this:
  Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4),  
net.bundleA.ServiceA

?

This would have the drawback that I have to know for building  
BundleAImpl which version
is imported by  by BundleA. This is somehow dangerous. I'd like to  
have this automated.

Is there any possebility to have this automatically?

regards
Matthias


Am 25.09.2009 um 20:29 schrieb Felix Meschberger:

> Hi,
>
> Matthias Neubert schrieb:
>> Hello,
>>
>> this time I have got an question about a best practise regarding  
>> Felix
>> and iPOJO
>>
>> BundleA contains only a Package with an Interface, which it  
>> exports. It
>> imports another Package with Interface from Interface-BundleB. 
>> (which is
>> needed for describing BundleA's Interface)
>>
>> Exp.:
>>
>> BundleB:
>> Export-Package: org.bundleB.ServiceB
>>
>> BundleA:
>> Import-Package: org.bundleB.ServiceB
>> Export-Package: net.bundleA.ServiceA
>>
>> An Implementation Bundle of BundleA's Interface (BundleAImpl) imports
>> BundleA's Packages for implementing it, and so also has to import
>> BundleB's Package:
>>
>> BundleAImpl:
>> Import-Package: org.bundleB.ServiceB, net.bundleA.ServiceA
>>
>>
>> My Intension is, to be shure that the bundles  BundleA and  
>> BundleAImpl
>> allways import the same package from same BundleB (to avoid e.g.  
>> version
>> conflicts)
>>
>> My think it must be something like BundleA is reexporting Package of
>> BundleB and BundleAImpl shuld be forced to import BundleB-Package  
>> over
>> BundleA.
>>
>> Question: are there any best practises to achieve this?
>
> I would not re-export bundleB package from BundleA. Rather I would tye
> the version used by BundleA closes to the version exported by BundleB
> and used by BundleA, e.g.:
>
> BundleB:
> Export-Package: org.bundleB.ServiceB; version=1.2.3
>
> BundleA:
> Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4)
> Export-Package: net.bundleA.ServiceA
>
> I think this should do the trick.
> Regards
> Felix
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Best practise question

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Matthias Neubert schrieb:
> Hello,
> 
> this time I have got an question about a best practise regarding Felix
> and iPOJO
> 
> BundleA contains only a Package with an Interface, which it exports. It
> imports another Package with Interface from Interface-BundleB.(which is
> needed for describing BundleA's Interface)
> 
> Exp.:
> 
> BundleB:
> Export-Package: org.bundleB.ServiceB
> 
> BundleA:
> Import-Package: org.bundleB.ServiceB
> Export-Package: net.bundleA.ServiceA
> 
> An Implementation Bundle of BundleA's Interface (BundleAImpl) imports
> BundleA's Packages for implementing it, and so also has to import
> BundleB's Package:
> 
> BundleAImpl:
> Import-Package: org.bundleB.ServiceB, net.bundleA.ServiceA
> 
> 
> My Intension is, to be shure that the bundles  BundleA and BundleAImpl
> allways import the same package from same BundleB (to avoid e.g. version
> conflicts)
> 
> My think it must be something like BundleA is reexporting Package of
> BundleB and BundleAImpl shuld be forced to import BundleB-Package over
> BundleA.
> 
> Question: are there any best practises to achieve this?

I would not re-export bundleB package from BundleA. Rather I would tye
the version used by BundleA closes to the version exported by BundleB
and used by BundleA, e.g.:

BundleB:
Export-Package: org.bundleB.ServiceB; version=1.2.3

BundleA:
Import-Package: org.bundleB.ServiceB; version=[1.2.3,1.2.4)
Export-Package: net.bundleA.ServiceA

I think this should do the trick.
Regards
Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org