It all depends on what you want to do.
When I work with design, I prefer (my choice) to not put any business logic
in servlets and JSPs (which are servlets).
I usually (depending on business requirements) divide up the layers like
this.
Front End Layer
Servlets, JSPs.
Responsible for presentation and navigation.
No business logic here.
These contact one or more session beans to pull out required data to
present.
Middle tier
Application Server
Responsible for input and output of data from the database.
Responsible for sending and receiveing presentation data to servlets/JSPs
Taking care of business logic that massages the data between DB and
presentation.
Backend Persistence
Database is only responsible for persisting data.
With the advanced databases today you can actuall put some logic in here
using stored procedures.
I prefere to put in mapping logic between the middle tier and the database
tables.
This is a very high level overview, I just like to point out that your
architecture should depend on your project,
not on my opinion.
Filip
jguich
<[EMAIL PROTECTED] To: [EMAIL PROTECTED]
OM.BR> cc:
Sent by: A Subject: The best approach
(Statistics and expanding)
mailing list for
Enterprise
JavaBeans
development
<EJB-INTEREST@jav
a.sun.com>
11/24/99 09:09 AM
Please respond to
A mailing list
for Enterprise
JavaBeans
development
reposting (i did not received!)
Hi,
thanks for all that answered.
here are the statistics:
jsp -> ejb : Tom, Filip, Tye, Vivek, Ian : 5 votes
servlet -> ejb -> jsp : Eric, Sachin, Javier : 3 votes
servlet -> jsp -> ejb: Vivek, GUICH : 2 votes
So', i think that jsp -> ebj wins.
Trying to expand these 3 possibilities:
a) jsp -> ejb
1) the browser sends data to the jsp
2) the jsp calls a SFS or a SLS (stateless session) that has the
business logic, and fetches data from db. it then sends the data back to
the jsp
3) jsp sends the data back to the page
b) servlet -> ejb ->jsp
1) the browser sends data to the servlet. this one manages the session
2) the servlet calls a StateFul Session (SFS) EJB that has the business
logic. This SFS access the db and create beans to the jsp. stateful or
stateless?
3) the jsp uses this beans to create the presentation, and send it
directly to the browser
c) servlet -> jsp -> ejb
1) browser sends data to the servlet. this one manages the session,
security, etc.
2) the servlet sends the parameters to jsp
3) the jsp gets data from a Entity EJB, creates the html and send
back to the browser.
is this really what you (all) think?
ps: before this discussion, i would vote on (c). after thinking a while, i
think that (b) instead of (c) is the best way, because:
1. it lets the servlet do what it really knows how to do: manage session's,
security, etc
2. it uses ejb to handle the busines logic with state??? sessions
3. it lets we create a framework of generic jsp outputs.
ps2: is a good approach servlet (with business logic) calling jsp directly?
ps3: i'm thinking in creating a good framework for lowering the maintenance
cost.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".