开发者

Build Dependencies In Eclipse Java Library Project For Multiple Providers

We are writing a JMS library in Eclipse to be used in our applications. Preferably, we want this to work with many JMS providers.

So we build our code around java interfaces and create provider specific implementation classes as needed.

What happens with build dependencies in projects like this, when many people work on one library, each one on implementation classes for some specific provider?

Say I have WebSphere MQ and write the code for th开发者_StackOverflow中文版at provider. And another guy writes for ActiveMQ. And another for some other JMS provider. Are we all supposed to have the relevant jars on our build paths, or are we supposed to accept having build errors for the code written for the other providers.

Some thoughts we have are: - to include the providers' jars with the project, - have separate build ant tasks, one for each IDE/programmer, - have the provider specific code in separate projects/jars???

None of the above looks perfect to us. Any recommendations?

Thank you tpav


You provide an interface (or in this case you use the JMS interface) that is defined independantly from the providers - you have to have this interface in your workspace to make your project compilable. And during runtime you will need a provider present and configured in order to bind the interfaces to the current implementations.

To achieve this, you have to have the JMS interface available in the workspace. For the specific providers I suggest using separate projects (one for each provider), that can be added as needed for execution.

I also suggest taking a look at OSGi (specifically services and/or fragments), as it supports several items required in this case, however, it comes at a bit steep (but manageable) learning curve.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜