有状态 Eclipse 插件 - 用于域模型的 OSGi 捆绑包?
我想将完整的域模型封装到 Eclipse 插件中,并公开一组服务以供其他插件使用。这个 Eclipse 插件需要存储状态,因为默认情况下我的域模型 在不同时间点都有一个状态,需要在 Eclipse 插件之间共享。
默认情况下,Eclipse 插件与 OSGI 捆绑包和 OSGi 捆绑包相同,因为它们基于 SOA,难道它们不应该是无状态的吗?
让 Eclipse 插件服务(扩展点)有状态是一个好习惯吗?
这是正确的方法还是有其他方法,例如将状态保存到硬盘并使插件无状态?
I want to encapsulate my complete domain model into an eclipse plugin and expose a set of services to be consumed by other plugins. This Eclipse Plugin needs to store state because my domain model by default
has a state at various points of time which needs to be shared across Eclipse plugins.
By default an Eclipse Plugin is same as OSGI bundle and OSGi bundles since they are based on SOA shouldn't they be stateless?
Is it a good practice to make an Eclipse Plugin services(extension points) stateful?
Is this the right approach or is there some other way like persisting state to hard disk and making the plugin stateless?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
服务无状态性是一个目标,而不是一个原则。最后,作为架构师,您必须决定服务是否必须真正无状态。话虽如此,您还是用两跳连接了跳跃 - OSGI 早于 SOA,并且不一定等同于 SOA,尽管在表面层它们似乎有一些相似之处(模块化、服务发现……)。
在你的框架内做任何有意义的事情。
Service statelessness is a goal, not a doctrine. At the end, you as the architect must decide if a service must truly be stateless. Having said that, you connected the jumps with two hops - OSGI predates SOA and is not necessarily equivalent to it, though at the surface layer they may seem to share some similarities (modularity, service discovery, ...).
Do whatever makes sense within your framework.