模块化 - osgi 和数据
我正忙于 osgi 的研发及其在技术堆栈中的作用。我相信整个模块化以及从软件组件的角度来看它带来的好处。现在,我正在努力弄清楚以下陈述的实际要素
“OSGi 的一个有趣功能是捆绑包的多个版本可以部署到同一个容器。部署在 OSGi 容器中的所有捆绑包都在一个 JVM 中运行”
这对我来说是理想的,也是真正的要求,但实际上是这样的如果我们谈论管理数据的软件组件,甚至是可行的。因此,部署捆绑包的多个版本(或至少向后兼容的版本)是有意义的,但如果该组件正在管理数据或资源……我们所说的是对数据和资源层的影响。它们是否同样必须在容器中同时拥有多个具有凝聚力的版本?如果存在 2 个捆绑包,它们都是次要版本,但对第二个捆绑包数据模式中的资源/数据层施加了重大约束……这不会造成问题吗?
我的问题是这到底能走多远。这是确保我们始终部署主要捆绑包之一并希望次要捆绑包并行共存的情况吗?我担心有人关注实际的物理 jar 包本身......但没有关注实际的数据/资源是有任务的。
有人遇到过这个困境吗?
I am busy with R&D with osgi and its role in the technology stack. I buy into the whole modularity and benefits this gives from a software component standpoint. Now, what I am battling to get my head around is the practical elements of the following statement
"An interesting feature of OSGi is multiple versions of a bundle can be deployed to the same container. All the bundles deployed in an OSGi container run in one JVM"
This is ideal and really truly a requirement for me, however in practical terms is this even feasible if we speak about software components managing data. So it makes sense to have multiple versions of a bundle deployed (or at least backward compatible versions) but if that component is managing data or a resource..what are we saying are the implications to the data and resource layer. Do they equally have to have multiple and cohesive versions of themselves simultaneously in the container. If 2 bundles exist where they are minor versions, but there was a significant constraint imposed on the resource/data layer imposed in the 2nd bundle data schema...wouldn't this pose a problem.
My question is how far can this really go. Is it a case of ensuring we always have the 1 of the major bundles deployed and look to having minors co-exist in parallel. I am concerned that there is attention paid to the actual physical jar bundle itself...but no attention paid to the actual data/resource is has mandate over.
Anyone come across this dilemma before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
并排使用 2 个版本是否实用取决于捆绑包的作用。例如,2 个版本的 XML 解析器就可以了。但是 SWT 2 版本(在 Eclipse 中)不行,因为 SWT 管理显示资源。这就是为什么某些捆绑包被标记为单例以指示管理某些单一资源。
It depends what the bundles does as to whether having 2 versions side-by-side is practical. For example 2 versions of an XML parser is OK. But 2 version of SWT (in Eclipse) is not ok since SWT manages the display resource. This is why some bundles are marked as singletons to indicate the manage some single resource.