简体   繁体   English

我想就一只耳朵中的多个ejb罐子获得一些建议

[英]I would like to get some suggestion regarding multiple ejb-jars in one ear

I would like to get some advise. 我想得到一些建议。 I have an application which consist of modules. 我有一个包含模块的应用程序。 A module is sliced to 3 parts, so every module has: - libraries (shared jars, DTOs, beans) - swing stuffs - ejb stuffs 一个模块被切成3部分,因此每个模块都具有:-库(共享的jar,DTO,Bean)-swing组件-ejb组件

The whole is packaged in one ear file and it may contains many ejb jars, currently 3. To handle separated the ejb jars of the particular modules of my application is, I think, the easiest way to manage the whole. 整个文件打包在一个耳朵文件中,并且可能包含许多ejb jars(目前为3个)。我认为,处理我的应用程序特定模块的ejb jars是最简单的方法来管理整个文件。 Later I would like to use OSGi to handle the modules. 稍后,我想使用OSGi处理模块。 But, this is the future. 但是,这就是未来。

Every ejb jar has own persistence.xml and it works. 每个ejb jar都有自己的persistence.xml,并且可以工作。 I can deploy it, the hibernate creates the tables and I can use my application. 我可以部署它,休眠会创建表,我可以使用我的应用程序。 But I have that feeling this is not the best or proper solution to handle this "multiple ejb jars in one ear" situation. 但是我感到这不是处理这种“一只耳朵多个ejb罐”情况的最佳或适当解决方案。 I would like to know what is the best or proper solution or what is your suggestion. 我想知道什么是最佳或适当的解决方案,或者您的建议是什么。

Thanks in advance! 提前致谢!

The way you do it is actually the best OO-solution: you seperate your concerns. 实际上,这是最好的面向对象解决方案:您将关注点分开。

Moreover you also have more flexibility in the current situation: you can leave out or change one of the ejb jar files and your application will still deploy and keep working. 而且,在当前情况下,您还具有更大的灵活性:您可以省略或更改ejb jar文件之一,并且您的应用程序仍将部署并保持正常运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM