历史:为什么 Eclipse 基金会选择了 OSGi?
当时有并发技术吗? 与其他技术和本机(3.0 之前)技术相比,OSGi 的优势是什么?
Was there concurrent technologies at that time?
What was advantages of OSGi compared to other technologies and to native (pre 3.0) technology?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许 OSGi 的主要好处是能够分离单独的包。 这允许一个包向全局类加载器隐藏其依赖项。
很多时候,在构建大型系统时,一个组件将需要某个库,而另一个组件则使用同一库的不同但不兼容的版本。 在这种情况下,选择库的一个版本而不是另一个版本会破坏另一个版本。
JAR 和 WAR 的单独类加载器是一个早期尝试,它允许对单独和隔离的组件进行一些模块化和依赖关系管理。 如果您查看旧版本的 WebLogic 等,您会注意到它们将常用的库(例如 Xerces)重新打包在 weblogic.* 下,以免与您的应用程序可能希望包含的 Xerces 发生冲突。
使用 OSGI,每个包可以仅公开包含核心接口的单个包。 然后,每个包都可以使用自己的库,而不必担心上述的类路径类问题。
Perhaps the major benefit of OSGi is the ability to have isolated separate bundles. This allows one bundle to hide its dependencies from the global classloader.
Many times when building a large system, one component will need a certain library, while another uses a different yet incompatible version of the same library. In this case picking one version of the library over the other breaks the other.
The separate classloaders for JARs and WARs were an early attempt and at allow some modularisation and management of dependencies for separate and isolated components. If you look at older versions of WebLogic etc you will notice they repackage commonly used libraries (eg Xerces) under the weblogic.* so as to not have a clash with a Xerces your app may wish to include.
With OSGI it is possible for each bundle to only expose a single package containing the interface to the core. Each bundle can then use their own libs without worrything about the classpath class problem described above.
请访问以下站点:
Eclipse 3.0 平台:采用 OSGi 技术
Please visit the following site:
The Eclipse 3.0 platform: adopting OSGi technology