struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francisco Hernandez" <fhernan...@fhernandez.net>
Subject Re: Best Approach for Database Access?
Date Tue, 12 Feb 2002 21:47:07 GMT
could you guys post some sample psuedo code on how you guys implement this?

im very intrested in using EJBs in my web apps.. im just not too sure on
what the best way to do this is.

----- Original Message -----
From: "Thompson, Darryl" <Darryl.Thompson@allegiancetelecom.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Tuesday, February 12, 2002 1:17 PM
Subject: RE: Best Approach for Database Access?


> Hello Keith,
>
>  In my environment we employ options 2 and 3 but with this little twist:
>
>   3) EJB environment (CMP)
>      JSP -> ActionBean -> ( ServiceHelper -->ServiceLocator ) - >
> ServiceBean -> DB
>
> The ServiceLocator is a regular Java class that encapsulates all jndi Home
> lookup logic, and the ther ServiceHelper is also a regular Java class that
> contains methods to
> support the business model. All ServiceHelper methods are static and the
> Action Class calls these from the appropriate exec(..) method.
>
> We are still trying to get a handle on this framework so if this is in
left
> field let me know.
>
> Regards,
> Darryl
>
> > -----Original Message-----
> > From: Keith Chew [SMTP:keith.chew@jungledrum.co.nz]
> > Sent: Tuesday, February 12, 2002 2:47 PM
> > To: Struts Users Mailing List
> > Subject: RE: Best Approach for Database Access?
> >
> > 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:Paul.Idusogie@stellent.com]
> > Sent: Wednesday, 13 February 2002 9:38 a.m.
> > To: struts-user@jakarta.apache.org
> > 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: paul.idusogie@stellent.com
> > website: http://www.stellent.com
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message