File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes how modules interact with each other? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how modules interact with each other?" Watch "how modules interact with each other?" New topic

how modules interact with each other?

Durga Krishna

Joined: Jul 10, 2006
Posts: 11
1)How to combine two or more servlets?
2)Suppose I have developed a module in my project using servlets and jsp.And my colleques has developed thier modules.How these modules can interact with each other?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

Its hard to make servlets work with each other when coded by separate developers. What you need to work on is well defined contracts between each other such as agreeing on simple POJO transfer objects and firm input/outputs of each servlet. It doesn't have to be complicated (in fact simple is better) but it has to be rock solid and clear. The clearer the contract, the easier integration will be.

Although once you go this far, you've got something that probably looks like a web/ejb service so if possible go with them since they have very well defined contracts.

Also read up on encapsulation and the blackbox methods of programming such as never allow external access to a variable (use getters/setters for all data access). This way if one of you changes your internal structure, the other is not affected.

[OCA 8 Book] [Blog]
I agree. Here's the link:
subject: how modules interact with each other?
jQuery in Action, 3rd edition