I am a big hibernate fan, but for my needs I might not need such a big tool to 
accomplish my goals.  I like the Spring JdbcTemplate for data mapping and data 
access techniques because its simple and I control the SQL.  The downsides are 
I dont get automatic dialect and all the other cool features of hibernate, but 
thats ok because I dont need them.  By using a separate DAO and Service layer I 
could somewhat easily swap out Hibernate for Spring JdbcTemplate in my DAOs and 
thus not affect any of my application flow logic since the Service API remains 
unchanged.

 


 
> Date: Tue, 24 Feb 2009 14:56:30 -0600
> Subject: Re: Struts 2 Architecture - Best Practices...
> From: burtonrho...@gmail.com
> To: user@struts.apache.org
> 
> Thank you for the replies. That is very helpful. Sounds like I will
> remove all dao into service layer.
> 
> (Off topic:)
> Why might you switch back to jdbc as opposed to hibernate. What
> obstacles are you facing there?
> 
> On 2/24/09, Andy <andrh...@hotmail.com> wrote:
> >
> > Right now I am using Struts2, Spring, and Hibernate. Although the Spring
> > JdbcTemplate is looking better all the time.
> >
> >
> >
> > I follow this: Action --> Service --> Dao
> >
> >
> >
> > Yes it is more code, but the benefits are in testibility, componentization,
> > and maintenance.
> >
> >
> >
> > I even have this: Action --> Service --> JSP so that I can wrap my
> > business objects instead of adding formatting functionality, etc directly to
> > my nice b.o. pojos.
> >
> >
> >
> > That's just how I do it.
> >
> >
> >
> >> Date: Tue, 24 Feb 2009 07:42:50 -0600
> >> Subject: Struts 2 Architecture - Best Practices...
> >> From: burtonrho...@gmail.com
> >> To: user@struts.apache.org
> >>
> >> I am curious to know what structure many of you use to organize and
> >> separate your struts apps. I can't seem to find a "standard" in this
> >> regard. I started with a simple application, and of course, it has
> >> grown to where more separation of logic layers is a must. Right now I
> >> have Presentation Layer (jsp & action classes) and a data layer (DAO &
> >> DAO Implementation classes). I am upgrading this application to use
> >> Struts 2, Spring, JPA, & Hibernate. Right now many of my action
> >> classes directly use my dao classes with some exceptions where the
> >> logic was complicated. Is it the general consensus that there should
> >> be NO access to DAO in the Action classes? If so, it seems like this
> >> could create quite a few "Service Layer" classes (perhaps I'm wrong on
> >> this). I know there is no :correct: answer, but would love to hear
> >> from the experts as to what you do in this regard.
> >>
> >> Also, would love to know any naming conventions or class organization
> >> structure you use (e.g. com.[company].action.*,.
> >> com.[company].service.*,. com.[company].entity.*,.
> >> com.[company].doa.*, etc) .
> >>
> >> Many thanks!
> >>
> >> Burton
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >
> > _________________________________________________________________
> > Access your email online and on the go with Windows Live Hotmail.
> > http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_AE_Access_022009
> 
> -- 
> Sent from my mobile device
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_________________________________________________________________
Windows Live™ Hotmail®:…more than just e-mail. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_explore_022009

Reply via email to