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 moving 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.


你可以看看Peaberry,这是为了架起OSGi和Guice的世界。

链接地址: http://www.djcxy.com/p/52072.html

上一篇: Python开发环境,如Smalltalk

下一篇: OSGi的指导原则,经验,技巧等