EJB 项目通常只包含一个 Enterprise JavaBean 还是它们的集合?
我正在使用 IBM Rational Application Developer for WebSphere;它基于 Eclipse,但我不确定它与 Eclipse 的 Java EE 功能有何不同。
我想要两个 Enterprise JavaBean。我是否应该创建两个单独的 EJB 项目(每个 JavaBean 一个),还是将它们作为不同的类放在一个项目中?
假设其中任何一个在技术上都是可行的,那么在这两者之间做出决定时需要考虑哪些因素?将它们分开或放在一个项目中的原因是什么?
I'm working with IBM Rational Application Developer for WebSphere; it is based on Eclipse, though I'm not sure of its differences from Eclipse's Java EE features.
I want to have two Enterprise JavaBeans. Do I create two separate EJB projects, one per JavaBean, or do I put them as different classes in one project?
What are the considerations when deciding between these, assuming that either is technically possible? What are the reasons to separate them or put them together in one project?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个 EJB 模块可以有多个 EJB(感谢上帝)。
我想说的是打包/部署考虑因素。如果出于某种原因您希望能够在企业应用程序中仅组装和部署这些 EJB 之一,那么请提供单独的模块。
经验法则是将事物逻辑地重新组合到同一个可部署单元中。仅当出现特殊部署需要时(罕见),才将逻辑组拆分为更细粒度的模块。
另请参阅
You can have several EJBs per EJB module (thanks god).
I would say packaging/deployment considerations. If for whatever reason you want to be able to assemble and deploy only one of these EJB in an Enterprise App, then provide separate modules.
The rule of thumb is to regroup things logically into a same deployable unit. Split a logical group into finer grained modules only if special deployment needs arise (rare).
See also