Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 January 19th, 2004, 05:44 PM
Registered User
 
Join Date: Jan 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tier separation

One thing has been bothering me as I read this book, and I'm hoping that someone who knows more about designing n-tier systems can explain this to me.

In the book, there are several instances where they pass a DataSet up out of the data layer, through the business layer, and up to the presentation layer. I can see why this is useful for databinding etc, but doesn't that totally break the concept of layered abstractions? Now, if I make a change to the database schema, the change is not localized to the Data Layer classes...it affects all layers.

Can anyone explain to me the reasoning behind this? It seems like a poor design.
 
Old February 18th, 2004, 11:47 PM
wwz wwz is offline
Registered User
 
Join Date: Feb 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just finished reading some part of the Chinese version of this book. I don't think the structure of the example system is good either.

But in my opinion, it's good idea to use datasets in biz tier and UI tier, for the benefit of databinding, data version control etc.

For a good designed n-tier system, these datasets must be defined in biz tier, with biz tier's logic. We define these dataset just like we define a struct type, or a class. The data tier's job is to map the data between database and these biz-defined dataset.

Use the .xsd to define your own dataset, then create the class automatically in visual studio.

Biz tier and UI tier should not use any datasets but those being defined this way. So all the dataset returned by data tier should be these biz-defined dataset. Use TableMappings in data tier object to map the raw dataset into biz-defined dataset is quit simple.

How do you think about it?
 
Old February 29th, 2004, 10:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by djm2cmu
 In the book, there are several instances where they pass a DataSet up out of the data layer, through the business layer, and up to the presentation layer. I can see why this is useful for databinding etc, but doesn't that totally break the concept of layered abstractions? Now, if I make a change to the database schema, the change is not localized to the Data Layer classes...it affects all layers.


You're right. The solution I prefer for databinding is to use custom collections, as described in the APress book: Real World ASP.NET Best Practices. By using collections you can control what info is passed between layers and you don't have to pass every field in the DB. The collections are each created by a business object. The business object layer reads from the data layer and creates the desired collections, and they are passed up to the presentation layer.

However, having said that, it's very hard to isolate changes to one layer because many changes will inherantly apply to more than one layer. But it does help with small changes - like if you want to add one field to be used by one functional area, you want to keep that change contained as much as possible.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between 3 tier and N-Tier architecture Manoj Bisht ASP.NET 2.0 Professional 2 May 9th, 2008 08:42 AM
Separation between ui and bll flowjob BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 July 11th, 2007 08:55 AM
3-tier architect rajdotnet .NET Framework 1.x 2 November 3rd, 2006 07:01 PM
3 Tier example fj8283888 Pro VB.NET 2002/2003 1 August 2nd, 2006 03:44 AM
For n-tier application Ned XML 4 July 27th, 2005 04:54 AM





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