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 June 7th, 2007, 09:36 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Why not using .NET's ProviderBase

Hi,

I was reading MSDN's custom provider articles and wondering why TheBeerHouse is not using .NET's ProviderBase, since it's already there available to use, and the framework will call ProviderBase's Initialize(...) method automatically for provider initialization. Why create DataAccess class rather than using ProviderBase? I noticed that DataAccess has some helper functions such as ExcecuteNonQuery..., but other than that, are there any other benefits? Maybe I'm missing some pieces, but any information will be really appreciated

Link to the article I was reading:

http://msdn2.microsoft.com/en-us/library/aa479038.aspx

Beier
 
Old June 9th, 2007, 12:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't think of a DAL as being a provider. A provider is a type of plugin that allows you to access a certain kind of data. A provider can go between the DB and the DAL. But I don't think descending from ProviderBase brings any benefit to the DAL itself.

Inheritance is useful where you want to leverage existing functionality and extend it. The Initialize method itself doesn't seem to offer much of what we'd need.

Try creating your own DAL this way and see if it buys you anything in the end. It might, but I just can't see it right now.

Eric

 
Old June 9th, 2007, 02:33 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Eric, thanks for the reply and insightful thought. I agree with you that DAL and provider are not exactly the same thing. IMHO Provider is more like a helper that bridge DAL and BLL. I was trying to think out what .NET's pure provider can provide other than initialize but haven't come up with anything essential. I think I'll stick with BeerHouse way.

Beier

Beier Cai





Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of VB.NET's Shell function in C# jude_wong C# 8 December 16th, 2005 07:49 PM
.NET's custom control and form lok_tan All Other Wrox Books 0 July 17th, 2005 10:10 AM





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