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: Architecture: Passing Objects from Business to UI Layer
PostPosted: Tue Aug 05, 2008 10:38 am 
Newbie

Joined: Wed Dec 12, 2007 9:20 am
Posts: 3
Hello,

currently I've developed a first version of a .NET 3-tier web architecture (Persistence + Business + Presentation ASP.NET) + Domainmodel.

In the last few weeks I thought about the architecural question if it's good practice to pass my persistent object from the business layer direct to the presentation layer or to use DTOs.

It's great to use lazy loading in the presentation layer but is it a good technique that the presestion layer is able to manipulate persistent objects without calling the business logic?

What solution would you prefer? Or is there any best practice out there?

I am curious about your suggestions!
Thank you and with kind regards

Philip


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 07, 2008 5:10 am 
Newbie

Joined: Sat Apr 05, 2008 6:33 pm
Posts: 16
If you need UI specific information or logic in a domain model then it can be a good idea to wrap it in a presentation model. I usually use the doman model directly in the presentation layer unless i have the above mentioned need.

It is really good to have a presentation model sometimes as you can add properties that makes the presentation logic easier and cleaner but it is a lot of overhead (in code / coding) to create presentation model duplicates of your domain model so I only do this on when I see that it will be worth it :)

A side note, it sounds like your are not talking about a N-tier application but a layered application, tier means seperate processes, like in a client-server architecture.

http://en.wikipedia.org/wiki/N-tier


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 13, 2008 10:59 am 
Newbie

Joined: Wed Aug 13, 2008 10:32 am
Posts: 3
Hi (my first Post)

I have a similar app, but a different problem and am looking for suggeestions.

This is all new to me so I hope I get my terminology right. We have a .Net multi-layered application, consisting of Data, Application, service and presentation layers. (We're using Spring & MVC)

The problem is trying to find a solution between Lazy loading and Deep loading. On one had we want to make as few calls to the database as possible, and certainly don't want lazy loading from the presentation layer (we don't have access to the lazy laoding proxies over the remoting channel). On the other hand, deep loading all our objects is just impossible as we have some fairly complex domain models.

What we'd like is to be able to specifcy which parts of a domain model we want NHibernate to bring back.

eg: If an object has many one to one releationships and some one to many relationships is it possible to specify at run time which of the relationships NHibernate should populate?

Thanks, I hope this makes sense ...


Mike


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.