-->
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.  [ 5 posts ] 
Author Message
 Post subject: application design with struts and hibernate
PostPosted: Wed Aug 31, 2005 2:24 pm 
Newbie

Joined: Fri May 27, 2005 3:19 pm
Posts: 18
Should there be anything in between Hibernate and Struts, or would it be acceptable to populate action forms with Hibernate persistant objects?
I am trying to keep it as light as possible :)

Thanks,
Oleg


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 2:36 pm 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
I didn't really understand your question. Are you asking if it's possible to use Struts + Hibernate? If so, yes. I'm developing a project with this too tools and will be glad to answer if you have questions.


Top
 Profile  
 
 Post subject: Re: application design with struts and hibernate
PostPosted: Wed Aug 31, 2005 2:38 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
icon911 wrote:
Should there be anything in between Hibernate and Struts, or would it be acceptable to populate action forms with Hibernate persistant objects?
I am trying to keep it as light as possible :)

Thanks,
Oleg


If you're suggesting mapping your ActionForm objects directly with Hibernate, I would definitely recommend against it. But copying Hibernate persistant objects to/from the ActionForm properties, as-needed, is the way we do it.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 3:06 pm 
Newbie

Joined: Fri May 27, 2005 3:19 pm
Posts: 18
Thanks for the response and I apologize for not being clear.
I see what you mean about ActionForm itself being mapped by Hibernate, but lets say ActionForm has a collection that will be populated with objects, can those objects be Hibernate persistent? Or should I create an object that will have its values copied from Hibernate object and than add it to collection?

Have a feeling its not a good idea still, but I am just getting desperate in terms of conserving memory used :)

Thanks
Oleg


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 31, 2005 3:10 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
I'm sure many people would argue each way. If you're only displaying the data, I'd say go ahead and use the persistent objects in the form.

The issue I've run into is with forms usually being only String or boolean types and doing validation and type conversions afterwards, before persisting the data.

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.