Hi Paul

I follow this design practice for both EJB and non-EJB applications. The
ones marked with * live at the application server JVM.

(1) Non-EJB environment
=======================
JSP -> ActionBean -> ServiceBean -> DaoBean -> DB

(2) EJB environment (BMP or Session)
====================================
JSP -> ActionBean -> * ServiceBean -> * DaoBean -> DB

(3) EJB environment (CMP)
=========================
JSP -> ActionBean -> * ServiceBean -> DB

Notes:
======
ActionBeans are the action classes of Struts
DaoBeans are normal JavaBean classes which knows how to communicate with the
DB, ie all SQL code goes here.
In (1), you need to take care of transactions on your own.
The ServiceBean in (1) is a normal JavaBean, but an EJB in (2) and (3)
In (3), we do not need a Dao, since the CMP does all that work for us.

Hope this helps
Keith

-----Original Message-----
From: Paul Idusogie [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 13 February 2002 9:38 a.m.
To: [EMAIL PROTECTED]
Subject: Best Approach for Database Access?
Importance: High


Could you kindly provide guidance on the best approach to implement database
access.?
I have encountered various schools of thought in my reading, that suggest
extracting the business logic and database code from the jsp into a jsp bean
or ejb or servlet.

Thanks,

Paul Idusogie
Technical Architect
Consulting Services
Stellent Inc.
7777 Golden Triangle Drive
Eden Prairie, MN 55104
Desk: 952.656.2755
Fax: 952.903.2115
Email: [EMAIL PROTECTED]
website: http://www.stellent.com

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to