OSGi解决了什么? [英] What does OSGi solve?
问题描述
我在维基百科和其他网站上阅读了有关 OSGi 的内容,但我并不是真的看到大局。它说它是一个基于组件的平台,您可以在运行时重新加载模块。另外,给出的实际示例是Eclipse插件框架。
I've read on Wikipedia and other sites about OSGi, but I don't really see the big picture. It says that it's a component based platform, and that you can reload modules at runtime. Also the "practical example" given everywhere is the Eclipse Plugin Framework.
我的问题是:
-
OSGi的清晰简单定义是什么?
What is the clear and simple definition of OSGi?
它解决了哪些常见问题?
What common problems does it solve?
常见问题我指的是我们每天面临的问题,例如OSGi可以做些什么来提高我们的工作效率/乐趣/简单?
By "common problems" I mean problems we face everyday, like "What can OSGi do for making our jobs more efficient/fun/simple?"
推荐答案
我从OSGi中找到了以下好处:
I've found the following benefits from OSGi:
- 每个插件都是一个版本化的工件,它有自己的类加载器。
- 每个插件都依赖于它包含的特定jar和其他特定的版本化插件。 / li>
- 由于版本控制和隔离的类加载器,可以同时加载同一工件的不同版本。如果您的应用程序的一个组件依赖于一个版本的插件而另一个组件依赖于另一个版本,则它们可以同时加载。
通过这种方式,您可以将应用程序构建为一组按需加载的版本化插件工件。每个插件都是一个独立的组件。正如Maven帮助您构建构建所以它是可重复的,并由它创建的一组特定版本的工件定义,OSGi可以帮助您在运行时执行此操作。
With this, you can structure your application as a set of versioned plugin artifacts that are loaded on demand. Each plugin is a standalone component. Just as Maven helps you structure your build so it is repeatable and defined by a set of specific versions of artifacts it is created by, OSGi helps you do this at runtime.
这篇关于OSGi解决了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!