-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: if anyone knows tradeoffs of hibernate/struts combination
PostPosted: Fri Sep 09, 2005 3:56 am 
Newbie

Joined: Mon Aug 22, 2005 3:34 am
Posts: 7
plz if anyone can help me locating

advantages and disadvantages of using hibernate with struts


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 09, 2005 5:19 am 
Beginner
Beginner

Joined: Thu Sep 08, 2005 10:29 am
Posts: 21
If you are stating a new webapp project with Struts you maybe want to reconsider using Spring instead (or even in combination with Struts-Hibernate).

*As far as I know* Struts have no specific Hibernate support. They support in using datasources but nothing specific for Hibernate.

However Spring is offering specific Hibernate support.
You can use this in combination with Struts-Hibernate or even use Spring MVC instead of Struts. But this dependent on what you want and on the experience of the development team.

Hopes this helps a bit.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 09, 2005 11:01 am 
Newbie

Joined: Wed Aug 31, 2005 1:01 pm
Posts: 2
Location: Louisville, Colorado
I'm having no problems using Struts w/ Hibernate. A DAO layer is nice, in which case the two don't necessarily interact with other directly. A typical request might go like so:
1. Create and validate your Struts ActionForm instance
2. Your Struts Action populates one of your persistance classes from the ActionForm by using BeanUtils.copyProperties (from commons-beanutils.jar).
3. The Struts Action hands off the persistance class to a DAO, which uses HQL, Criteria API, etc., to interact with Hibernate.
This is just an example, your architecture could be simpler or more complex.

Also, take a look at the Thread Local Session pattern http://www.hibernate.org/42.html, and the HibernateFilter http://www.hibernate.org/43.html to manage creating a Session for each request. Also, there is an example of a Struts plugin to handle creating a SessionFactory for the application on startup: http://www.hibernate.org/105.html

_________________
--
David Tobey
SoftSlate, Inc.
SoftSlate Commerce Java Shopping Cart Solution
http://www.softslate.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.