开发者

Looking for Guice-to-OSGi guiding principles, experience, tips, etc

Guice is a great framework to separate API from implementation and to start modularizing your applications. OSGi is a great framework to load versioned services in their own secured environment and to offer these via an exported API.

Assuming an application has been developed with Guice and that its size now justifies mov开发者_运维技巧ing to OSGi to convert early modules into new fully-fledge services, what are the driving steps to perform this move?

I am looking for guiding principles, step-by-step to do list, war experience, tips, caveats, etc...


OSGi already offers dependency injection for services when using Declarative Services (DS) (like Felix SCR). This is standard in OSGi, and for portability across different OSGi frameworks DS is the way to go. I think Peaberry is doing exactly what standard DS is doing, but in a Guice way.

If I were to port a Guice application to OSGi, I would keep Guice dependency injection inside each bundle, and use DS for the injection of services between bundles in order to keep the compatibility with all the OSGi frameworks.


You could take a look at Peaberry, which is intended for bridging the worlds of OSGi and Guice.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜