-->
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.  [ 1 post ] 
Author Message
 Post subject: Design question regarding business layer and hibernate
PostPosted: Wed Nov 30, 2005 12:19 pm 
Newbie

Joined: Wed Nov 30, 2005 11:13 am
Posts: 10
Hi,

the app I am currently working on has got the following setup:
- database (Oracle)
- DOM objects (lazy loading for collections)
- DAOs (Spring managed)
- business layer (Spring managed)
- View1: Struts web application
- View2: rich client via web services

I've got two basic design questions regarding this setup:
a) I am using lazy loading, thus I have to initialize each required collection using Hibernate.initialize(obj.getCollection()) in my business layer. I cannot use the open session in view approach, because of the rich client. How should the business layer reflect my need for a varying population of collections (based on each request by the view)? A single method or multiple methods? Will I have to call initialize() on each object manually, or are there any service methods that could do this for me?

b) I do not want to expose the DOM objects loaded by Hibernate to either struts nor the rich client, because these objects/proxies will throw LazyInitializationExceptions if the view accesses uninitialized properties. IMO, this would be bad design, because the view (and even the business layer) should not know anything about hibernate. Thus, I'd have to use DTOs, which would be bad design as well. Is there another approach, that I am not aware of?

Thanks,
Tom


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

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.