Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes J2EE architecture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "J2EE architecture" Watch "J2EE architecture" New topic

J2EE architecture

SJ Rao

Joined: Mar 05, 2003
Posts: 25
We have created an web based application using JSP and Javabeans. We haven't used servlets or EJBs.
This application is basically a planning tool & which has lots of equations & computations.
Is this a good way of developing an application, or is it necessary that we need to use servlets & EJBs to achieve J2EE architecture.
Since I cannot categorize it as MVC architecture, which architecture does this application belong to, because when I am giving a demo to the client, I should be able to explain them.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I'd rather see the "front controller" pattern, maybe using Struts or some other package or building your own. People disagree on whether or not this is MVC, but think about what a few simple rules would do to your code:
* Front controller servlet has no HTML - only Java
* Page generator JSP (view) has no Java - only tags
* Business objects (model) have no HTML, no reference to servlet container, session, request, response, etc.
If your team is big enough to specialize in skills and break up into subteams, front controller with these simple rules help clarify who does what. If you might have multiple front-ends, say XML web services, WAP, fat clients, etc. they improve the odds of using the same business modules. Hope that sparks some good ideas!

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

If you use MVC it easy to maintain your code. I suggest you to have a FrontController to receive all your requests and then delegate it to some other class for further processiong.
Only only JSP's creates duplication of code and maintenance problems.
You may also like to consider using struts which is based on MVC.
EJB are not required unless you have serious TX, security requirements.

Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Oh, forgot to answer your question!
Look up "document view" pattern. Microsoft likes to talk about that instead of MVC. It combines the controller and view as you have done in your JSPs. I've really never looked for literature on it, so can't predict what you'll find. Good luck!
SJ Rao

Joined: Mar 05, 2003
Posts: 25
Thanks for all ur replies.
After going thru the knowledge bank of MVC & document/view architecture, looks like my application is page-centric design.
Let me know if my assumption is right.
There is also a feedback in previous queries that page-centric design is not a good way of design, & i totally agree with this.
James :- I found this article about document/view architecture for java
Document/View Architecture[/B]
Java provides a mechanism for setting up a document/view relationship between classes, in which the view classes take full responsibility for controlling the process. The only responsibilities of the document classes are to provide features to support the view classes and to perform a notification operation to signal the view classes when a document object's data has changed in a way that a view object may need to be aware of.
I agree. Here's the link:
subject: J2EE architecture
Similar Threads
J2EE Unleashed by Joseph J. Bambara and Paul R. Allen
ReDeploying EJB == Servlet problems
Advise needed
J2EE architecutre