application suites and multiple war files - need your input!


Web tier: servlets, JSP, Web frameworks: application suites and multiple war files - need your input!

  1. We are in the process of developing an application suite that contains multiple applications such HR, Financial, etc. They are indenpendant and yet inter-related. They need to be installed stndalone or in a integrated suite. They also share some common functionallies and share a unitfied database schema (also, a common persistence framework, likely JDO). BTW, this is a pure web app without EJB tier. Now my design questions:
    1. Anyone has done similar thing? how do you architect this kind of application suite?
    2. It would may sense and make the development process more streamlined and easier to test if each app is by itself a war. also some common functionality can be separated into another war that will be needed for all apps (standalone or integrated with other apps). What are the pitfalls with this approach?
    3. how about the approach that we put all apps in a single war?
    your thoughts and suggestions are very much appreciated!
  2. I think you are correct in separating your apps into different WARs. The main problem is how to manage the "common" code among all the WARs.

    I can think of a couple options:

    1. Manage the common code during your build process. Simply copy the duplicate code into every Web Application. So long as all your code is stored in the same environment (e.g. all in the source code control system), this should work, although it is a bit memory-inefficient.

    2. Put all your WARs into a single EAR. Put the common code in a JAR inside the same EAR. Whether this actually works depends on the server you use, and whether it manages multiple WARs in the same EAR correctly (or supports EAR at all).

    3. Put your common code in a "common/lib" directory, making it global to the entire server. This is very memory-efficient, but you may find that you cannot "hot deploy" your common code, and will have to shut down the server to update it.

    I suggest you expirement with 2 and 3 on your server, and if you have trouble, default to 1 (which will work no matter what).

    Another more complex issue is how to manage shared data. I suggest you avoid shared data, since it will tie your applications more tightly together. The only area where you might want to have shared data is a common login. Look into the documentation of your server to see how/if it supports common logins for differnt Web Applications. If it doesn't, spend some time figuring out how you are going to manage it.
  3. We are in the same process except our applicationj suite does have an EJB tier. As we are a few weeks from starting, I would appreciate reading about any feedback you have on the suggestions posted by the previous reply. Thanks!
  4. Wanted to add that another concern is the ability to change a portion of the application suite and deploy without effecting the other portions. In this example, change one WAR without having to "touch (using ANT)" another WAR in the deploy process. This has been a major hurdle for us in the past we have not yet come up with a good solution. What is everyone else doing?
  5. If your server doesn't support EARs, you can create a seperate project with all of you JDO and business objects or any other reusable components you may have. Package thoses classes into a jar and add the jar to all of your WEB-INF/lib directories for all of your WARs.

    You should also use ANT to manage your code as it can really help in compile, packaging and deploying your WARs.

    Hope this helps!