我在维基百科和其他网站上读过关于OSGi的文章,但我并没有真正看到大局。它说它是一个基于组件的平台,并且您可以在运行时重新加载模块。同样,到处都给出的“实际示例”是Eclipse插件框架。
我的问题是:
OSGi清晰而简单的定义是什么? 它能解决什么常见问题?
所谓“常见问题”,我指的是我们每天都要面对的问题,比如“OSGi能做些什么来让我们的工作更高效/有趣/简单?”
我在维基百科和其他网站上读过关于OSGi的文章,但我并没有真正看到大局。它说它是一个基于组件的平台,并且您可以在运行时重新加载模块。同样,到处都给出的“实际示例”是Eclipse插件框架。
我的问题是:
OSGi清晰而简单的定义是什么? 它能解决什么常见问题?
所谓“常见问题”,我指的是我们每天都要面对的问题,比如“OSGi能做些什么来让我们的工作更高效/有趣/简单?”
当前回答
OSGi提供了以下好处:
■基于Java的可移植安全执行环境
■服务管理系统,可用于跨包注册和共享服务,并将服务提供者与服务消费者分离
■动态模块系统,可用于动态安装和卸载 Java模块,OSGi称之为包
轻量级和可扩展的解决方案
其他回答
它还被用于在移动端带来额外的中间件和应用程序的可移植性。移动端可用于WinMo, Symbian, Android等。一旦与设备功能集成,就会出现碎片化。
OSGi提供了以下好处:
■基于Java的可移植安全执行环境
■服务管理系统,可用于跨包注册和共享服务,并将服务提供者与服务消费者分离
■动态模块系统,可用于动态安装和卸载 Java模块,OSGi称之为包
轻量级和可扩展的解决方案
其他人已经详细概述了OSGi的好处,我在此解释我所见过或使用过的实际用例。
In one of our application, we have event based flow and flow is defined in plugins based on OSGi platform so tomorrow if some client wants different/additional flow then he just have to deploy one more plugin, configure it from our console and he is done. It is used for deploying different Store connectors, for example, suppose we already have Oracle DB connector and tomorrow mongodb is required to be connected then write a new connector and deploy it and configure the details through console and again you are done. deployment of connnectors is handled by OSGi plugin framework.
我还不是OSGi的“粉丝”…
我一直在财富100强公司使用企业应用程序。最近,我们使用的产品已经“升级”为OSGi实现。
启动本地cba部署… [2/18/14 8:47:23 727 EST] 00000347 CheckForOasis
最终部署,“以下包将暂停,然后重新启动” 00000143 AriesApplicat I CWSAI0054I:作为应用程序更新操作的一部分
51分钟……每次代码改变…以前的版本(非osgi)在旧的开发机器上部署不到5分钟。
在一台有16g内存和40g空闲磁盘和Intel i5-3437U 1.9 GHz CPU的机器上
The "benefit" of this upgrade was sold as improving (production) deployments - an activity that we do about 4 times a year with maybe 2-4 small fix deployments a year. Adding 45 minutes per day to 15 people (QA and developers) I can't imagine ever being justified. In big enterprise applications, if your application is a core application, then changing it is, rightly so (small changes have potential for far reaching impacts - must be communicated and planned with consumers all over the enterprise), a monumental activity - wrong architecture for OSGi. If your application is not an enterprise application - i.e. each consumer can have their own tailored module likely hitting their own silo of data in their own silo'd database and running on a server that hosts many applications, then maybe look at OSGi. At least, that is my experience thus far.
在它的官方网站上已经有了一个很有说服力的声明,我可以引用
OSGi技术如此成功的关键原因是它提供了一个非常成熟的组件系统,实际上可以在数量惊人的环境中工作。OSGi组件系统实际上用于构建高度复杂的应用程序,如ide (Eclipse)、应用服务器(GlassFish、IBM Websphere、Oracle/BEA Weblogic、Jonas、JBoss)、应用程序框架(Spring、Guice)、工业自动化、住宅网关、电话等等。
至于开发商的利益?
开发人员:OSGi通过为当今大规模分布式系统和小型嵌入式应用程序提供模块化体系结构来降低复杂性。从内部和现成的模块构建系统可以显著降低复杂性,从而降低开发和维护费用。OSGi编程模型实现了基于组件的系统的承诺。
请参阅使用OSGi的好处。