我们将使用 J2EE 开发大型应用程序。该应用程序包含许多模块,少数模块不直接与客户端通信。(即它将在单独的线程中处理,如 SNMP 侦听器、作业调度、轮询等)。
因此,我们计划将应用程序拆分为基于模块的应用程序并在不同的服务器上运行,并与主 j2ee 应用程序集成以向用户展示结果。
任何人都可以帮助我如何创建基于模块的应用程序并运行可以在不同服务器上运行的应用程序吗?
我们将使用 J2EE 开发大型应用程序。该应用程序包含许多模块,少数模块不直接与客户端通信。(即它将在单独的线程中处理,如 SNMP 侦听器、作业调度、轮询等)。
因此,我们计划将应用程序拆分为基于模块的应用程序并在不同的服务器上运行,并与主 j2ee 应用程序集成以向用户展示结果。
任何人都可以帮助我如何创建基于模块的应用程序并运行可以在不同服务器上运行的应用程序吗?
First thing you have to do is you should have a clear logical idea about hierarchical view of the modules. For example consider you will be having a security based module which should be always on top, other core featuring module will depend on the higher level modules.In such a way you must have a clear view about the level of modules.
Have a building script like ANT for each module separately to build/jar that module, have a global level ANT to call all the individual modules as per the order.
Here, we have a similar architecture which has more than 10o different modules (both dependent on others and independent). Having these kind of structure you can able to skip any module that you don't wish, in a very simple manner.
Sample Global Ant script
--------------------------
<target name="build.projects">
<ant dir="${security.module}" antfile="build.xml" target="build.project" />
<ant dir="${core.module}" antfile="build.xml" target="build.project" />
<ant dir="${Resource.module}" antfile="build.xml" target="build.project" />
<ant dir="${SNMP.module}" antfile="build.xml" target="build.project" />
<ant dir="${util.module}" antfile="build.xml" target="build.project" />
</target>
and the Individual one..
<project name="security.module" default="all" basedir=".">
<target name="build.project" depends="-Properties, create.output, compile, jars" />
</project>