How to create module based application in J2EE for the large scale application?

306 views Asked by At

We are going to develop large scale application by using J2EE. The application has contains many number of modules and few modules are not directly communicate with the client.(ie it will be processing in separate thread like SNMP Listener, job scheduling, polling, etc).

So we are planed to split the application into module based application and run it on different servers and integrate with main j2ee application to show the result to users.

Can any one help me that how to create module based application and run the application which can run it on different server?

1

There are 1 answers

4
Sankarganesh Eswaran On
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>