Web project architecture question, mulitple .wars vs a single .war

I am in the early stage of architecting a web project.

At this point, I've came up with two solutions:

Multiple .wars

Each section would be it's own .war that would be built into an .ear. This would allow a multiple developers to work on the project and if a change would be made, then only the changed .war would need to be built.

However, then I would have mulitple copies of the same library for each .war, so that could slowly become a maintenance nightmare.

Also, I haven't figured out how to communicate between each .war - I don't believe I can cross container context?

Single .war

I wouldn't have to worry about multiple copies of the same library files. Nor would I have to worry about losing session data between applications since I would be running under one container.

But I am unsure of the best way to have more than one developer work on the project? It was suggested that I look at cruise-control at sourceforge.net - an automated build process - thus developers could check in their source code and a build would happen every xx minutes.

What is the best way to approach a project that is made up of multiple applications that need to be under one application suite?

Thanks,

--Todd

[1291 byte] By [jtp512a] at [2007-10-3 3:30:22]
# 1

No easy answers here. If the projects are fairly independent, multiple wars is a better solution. The libraries can be shared across multiple wars in a container specific way.

If the apps need to share information, a single war is the best choice. In this case, you might want to develop the projects as different wars, but then create a separate project for integration that combines all individual web.xml

inder0a at 2007-7-14 21:24:16 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Hi,

I would recommend starting with the simple case which is using a single war file. You can use multiple wars, but it can add a bit of complexity and force you to learn a few advanced fetaures to get started. You can also share common libraries among multiple war files inside an ear file, and Java EE has mechanisms to allow that sharing (BluePrints has a document on adding libraries to Java apps at

https://bpcatalog.dev.java.net/nonav/enterprise/portableextensions/frames.html ) but it is does add a bit of complexity for you to learn initially.

A good rule of thumb is to start with one war file, and only split into other war files if really necessary. The most common style is one war file.

hth,

Sean

seanbrydona at 2007-7-14 21:24:16 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...