-->
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.  [ 2 posts ] 
Author Message
 Post subject: Struts Form = Hibernate POJO = DTO ?
PostPosted: Fri Mar 31, 2006 2:43 pm 
Newbie

Joined: Mon Aug 15, 2005 7:53 pm
Posts: 8
Location: Córdoba, Argentina
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

Hi Hibernate Community. I'm facing this issue since a long time...
The thing is, I have the hibernate POJO (mapped beans), the data transfer object, and the struts form... and they all look almost the same!

And I don't want the POJO to extend ActionForm... and thou I HATE DTOs (duplicated code), it's the only way of isolating the business tier from the data access tier, since the business tier should know anything about hibernate.

My app architecture looks like this:

JSP -> Struts -> Business Object (business logic) -> DTOs -> DAOs -> Hibernate -> Oracle

It seems over-engineered to me... that's why I'm looking for your opinions...

thanks in advance

Matías


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 02, 2006 8:40 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Please look at my presentation materials to see how POJO can be used directly in the Struts Forms, so it is NOT necessary to duplicate code. Necessity to duplicate is the common misconception among Struts users :(

Although there are situations when we do need to duplicate object fields in action formss...

http://sandbox.sourcelabs.com/kosta/sas ... img18.html
http://sandbox.sourcelabs.com/kosta/sas ... img19.html
http://sandbox.sourcelabs.com/kosta/sas ... img20.html

All the source code and live demo links are available from here:
http://sandbox.sourcelabs.com/kosta/

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


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