Hi,

well, I can use DTO but AFAIK, it would be a bad design decision to use them, because it would basically mean that I have to copy all my DOM-objects. So if there changes in the DOM, the DTOs would have to be manually updated. Apart from that, it would mean:

Hibernate -> DAO ->  Business layer -> covertDOMToDTO -> DTO -> View
and then in case of an update:
View -> DTO -> Business layer -> convertDTOtoDOM -> DAO -> update()

-> IMO, lots of trouble, an additional error risk and poorer performance.

That's why I thought, it would be prudent to avoid using DTOs.

Tom

Marco Mistroni wrote:
Hello,  
        Any reason of why you can't use DTOs?
Your domain objects and dto could implement the same interface..



HTH
        marco

-----Original Message-----
From: Tom Ziemer [mailto:[EMAIL PROTECTED] Sent: 30 November 2005 14:26
To: Struts Users Mailing List
Subject: slightly [OT] Hibernate and domain objects in web apps

Hi,

I have got a little problem with Hibernate - well actually it is only partially related to it:

My app uses Spring + Hibernate (lazy loading), but should I return the value beans (dom) from Hibernate to my Struts actions? If I do this, I'd have to deal with LazyInitializationExceptions for collections that have been lazy-loaded. In my opinion, this would be a horrible design because the view would have to know about the data access tier. On the other hand, I've read, that "DTOs are evil" - but how can I solve this problem without DTOs?

I am sure, lots of you are using Hibernate/{YOUR_LIST_OF_OTHER_GREAT_FRAMEWORKS_HERE}/Struts and I'd be grateful for any help.

Thanks,
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to