Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 21st, 2006, 05:26 PM
Registered User
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5: DataLayers Question

I just wanted to mention that I have doing ASP.NET for about 6 months now and would recommend this book but only after reading the beginner ones. The author assume that you have a good grasp on OOP concepts and experience with the n tier structure.

Back to my question, I was wondering is it really necessary for the BLL to rewrap the data returned from DAL in essentially the same wrapper?

for example: Returning a single Article by ID

- The UI (Show Article.aspx.cs) calls BLL.Article GetArticleByID(ID)

- The BLL calls the DAL.GetArticlesByID which creates an instance of the ArticleDetails object and wraps the data retrieve from the database and exposes the object with ArticleDetails public class members.

- The ArticleDetails object is then used as an argument for the BLL.GetArticleFromArticleDetails method, which then creates and an Article object from it and exposes the object with Article public class members (which are the same members as the DAL). The Article object is then returned to the UI.

Is there a way for the BLL to call the DAL and just pass the object to UI directly without rewrapping it?

 
Old August 21st, 2006, 07:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There are many possible ways to do it. The objective in a pure n-tier design is to avoid passing a DAL class all the way through to the UI layer. The idea is to hide DAL members from the UI. The DAL interface is a shared-secret only with the BLL.

The question is whether a pure design is always the best design. Sometimes performance issues cause people to make comprimises - I've even seen DataReaders passed from the DAL all the way to the UI. You need to weigh various factors and decide on a combination of design methodologies that you can live with.

I've never seen a real-world system that doesn't break the encapsulation rules at least in some ways. You do realize that in a pure n-tier design you wouldn't be allowed to put ANY functionality in stored procedures, right? Only basic crud is allowable in stored procs using a pure n-tier design because any logic is considered part of the business rules and that is only allowed in the BLL. Both the DAL and DB can only wrap data in a flat manner and do nothing more.

Eric

 
Old August 23rd, 2006, 09:39 AM
Registered User
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks... that makes sense to only exposes the UI to the BLL object and not the DAL object.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on Chapter 5 arholly BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 1 September 2nd, 2008 04:07 PM
Chapter 9 Small Question aspcoder BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 14 April 29th, 2008 01:51 PM
Chapter 4 question davidle1234 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 January 18th, 2007 12:18 AM
Another chapter 10 question. czambran BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 4 April 3rd, 2005 09:12 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.