views:

21

answers:

1

We have a debate going on .

a. The "standard" way of assembling a web app. Create a WAR with all our app artifacts and all other components like hibernate and memcached etc are deployed in the tomcat/shared/lib area.

b. Create a humongous war with everything included and nothing in tomcat/shared/lib.

Pros for a - It keeps things modular and the war is small. Cons for a - dependency on shared/lib has to be managed especially by the deployment process.

Pros for b - All dependencies are controlled by the build process removing any room for error. Cons for b - War is really, really big. If you are deploying over a network to a huge farm, then it might have an impact.

want to see what thoughts others might have about this.

+1  A: 

Actually, I thought B was the "standard" way :-)

I choose B nearly all the time. It's simpler for our customers - many of whom don't have skills administering java application servers - they just drop the WAR in to the place I tell them to and everything works.

It also works well with our build and deploy - the WAR is built using maven, so all necessary dependencies are included, and also can be deployed to our QA app servers using the cargo plugin.

It also avoids "WAR-hell" when you have several webapps requiring hibernate or some other dependency, but different versions.

I would choose A only when I cam in total control of the app server, and the overhead of duplicating the common libraries per webapp becames prohibitively large, or that I am able to ensure all the apps are tested with the same version of the dependencies. Then, I know the dependencies can be safely moved into the shared area of the app server.

mdma
Interesting. we are in total control of the server. You make good points but what about wanting to avoid having multiple versions of the same component in different webapps.Is that not a desirable objective from a ops/mgmt perspective? I am routinely finding multiple versions of XML parsers etc for no reason other than that it was not discouraged.
Master Chief
I agree with you - if you are in control of the apps and the server, then strive for convergence on the versions of 3rd party libraries. I use maven, which helps a lot with this. Even so, I see it as a version management issue rather than a deployment issue. That all apps have been tested with the same version of a lib means that lib can be shared, but the version management has to come first to pave the way for shared libs to be possible.
mdma
Yep, I agree. We use Maven to manage that. But there is some thought to moving to a single war and we are debating whether it is worth to change and are there benefits which others might have seen.
Master Chief