multiple WARs/EARs for a web application

Posted on 2010-08-18
Last Modified: 2013-12-02
I support a web application that consists of multiple modules. Each module is accessed via menu and modules may require to interact with each other to complete a particular transaction.
I want to understand if it is possibe and feasible to create a separate WAR file and treat each module as a stand alone web application. Then using some method make it possible for  modules (which are separate stand alone application) to talk to each other to complete the transaction.

If it is feasible, will there be any impact on the performance? Will the impact be significant?
Question by:javaCaravan0
  • 2
  • 2

Author Comment

ID: 33477519
still waiting for the feedback
LVL 33

Expert Comment

ID: 33508272

You can split up the business logic in the way you describe. The separate modules can even be deployed to different servers.
However, the modules cannot share objects in this scenario. They will have to communicate by web services, either synchronous (via http) or asynchronous via queueing/messaging. This raises the questions of security, transaction integrity, governance and some more.  
Also, your deployment is likely to become much more complex.

Despite the shortcomings, this very well may be the way to go. Application componentization is what SOA is all about :)


Author Comment

ID: 33510097
Thanks for the reply.
Let me clarify what you have explained above:
1. The only way for diffrent modules (designed as a stand alone web application) to interact with each other is via Web Services.
2. can you please elaborate more about your comment on security, transaction integrity and governance. Does web services not provide good security?


Expert Comment

ID: 33608821
I believe if you use an EAR file, you can share the objects & classes between the WARs and other java resources without issues.  A little more information on EAR in general is here in the wikipedia article.  If you were wanting to share objects between EARs, I think that would be when you would have issues as described above. 
From what I understand, an EAR file with multiple WAR files within it should meet your needs.  There may be some performance hit from the general overhead of breaking out the application into a more distributed fashion (more XML to parse, extra classes getting everything loaded) but probably nothing significant and likely well worth it to get the separation that you're hoping to achieve.
LVL 33

Accepted Solution

shalomc earned 500 total points
ID: 33616932
forgot about this thread :)

> 1. The only way for diffrent modules (designed as a stand alone web application) to interact with each other is via Web Services.
Well, it is not the ONLY way, but probably the best and most cost effective way.

As for security, integrity and governance:
When all the business processes ran in a single CPU, you
a. had no security authorization problem because the interfaces were internal and you trust internal processes.
b. had no security data leakage problem because internal processes do not use the network to communicate.
c. had no integrity problem because internal processes are usually complete and it is difficult to inject anything foreign into them.
d. all internal processes tend to fail together, so you do not have to manage SLA for each and every one.

When you split business logic among different components,
a. the interface is external and you have to ensure proper authorization, entitlement and authentication.
b. the data runs on the wire and can be sniffed.
c. due to network "noise" and disruptions the message can be incomplete, and things like proxies and IPS enable injection and modification of data on the wire.
d. it is common for a single module to fail while others did not, this must be taken into account.

These issues have solutions, but the thing is that they have to be addressed explicitly. web services  do not deal with any of these issues by default.


Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Spring Framework HTTPSession management 1 33
servlet filter example 37 59
Wordpress "chart" plugin recommendation 7 51
eclipse console opening separately 2 17
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question