473,320 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Question on two 'flavors' of data access layers

Good morning,

I have seen two different types of data access layers and I am
wondering which, if either, is considered best practice, or if one is
better suited to certain situations than the other.

The first type is the DAL described in this MSDN article as well as in
the tutorial on the www.asp.net website:
http://msdn2.microsoft.com/en-us/library/
aa581778.aspx#aspnet_tutorial01_dataaccesslayer_vb _topic3

This first type uses typed datasets to build a DAL and then creates a
Business Logic Layer made up of classes that access the table adapters
from the DAL. This type has the names of the stored procedures in the
DAL.

The second type uses a class to wrap all the database connection code
and that class is the data access layer. Then the BLL calls this
class to handle database operations. This type has the BLL pass the
names of the stored procedure to the DAL as a parameter.

I see these as two fundamentally different ways to handle three-tier
architechture. Is one considered more robust? I can see that the
second type would have a very reusable DAL if it was designed
properly.

Any comments, references, links, war stories, would be greatly
appreciated.

Thanks,
Kathryn

Jan 30 '07 #1
3 1271
Kathryn,
There really isn't any "Best practices" rule on this subject. Whatever
"floats your boat".
Personally, I prefer the latter one, typed datasets not ever having gotten
me particularly excited.

Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"kbutterly" wrote:
Good morning,

I have seen two different types of data access layers and I am
wondering which, if either, is considered best practice, or if one is
better suited to certain situations than the other.

The first type is the DAL described in this MSDN article as well as in
the tutorial on the www.asp.net website:
http://msdn2.microsoft.com/en-us/library/
aa581778.aspx#aspnet_tutorial01_dataaccesslayer_vb _topic3

This first type uses typed datasets to build a DAL and then creates a
Business Logic Layer made up of classes that access the table adapters
from the DAL. This type has the names of the stored procedures in the
DAL.

The second type uses a class to wrap all the database connection code
and that class is the data access layer. Then the BLL calls this
class to handle database operations. This type has the BLL pass the
names of the stored procedure to the DAL as a parameter.

I see these as two fundamentally different ways to handle three-tier
architechture. Is one considered more robust? I can see that the
second type would have a very reusable DAL if it was designed
properly.

Any comments, references, links, war stories, would be greatly
appreciated.

Thanks,
Kathryn

Jan 30 '07 #2
///
The second type uses a class to wrap all the database connection code
and that class is the data access layer. Then the BLL calls this
class to handle database operations. This type has the BLL pass the
names of the stored procedure to the DAL as a parameter.
////

This is when people use some helper class....as their DAL. this is
deficient in my opinion.
The helper is NOT the DAL. it ~~helps the DAL. That's where some make the
mistake.


Read my article:
5/24/2006
Custom Objects/Collections and Tiered Development
http://sholliday.spaces.live.com/blog/

Where I outline some issues that you typically find. Alot of people throw
around the terms "layer" "data access layer" "tiers" etc, but its not always
well understood.

The goal of your DAL is to isolate you from the RDBMS you are using.

In my world, the dal returns
DataSets
IDataReaders
void/nothing
a scalar value
and nothing else.

.................
We'll call this option #3 since its not really what others are doing.

I'm not a table adapter person.

..

Also, read my post
http://groups.google.com/groups/sear...abaseObject%22
go to the first hit, and find my entry:

Date: Mon, 20 Nov 2006 23:03:29 -0500
Local: Mon, Nov 20 2006 11:03 pm
that's if you think you're writing a DAL, which sometimes will hit one db,
and sometimes hit another one.

Here is another good example at:
http://groups.google.com/group/micro...cess+layers%22
(first hit)

And, in my blog I show this
And a reference to read from start to finish, aka, very informative for a
bird's eye view:
*
http://msdn.microsoft.com/library/de...tml/BOAGag.asp

I read that thing about every 4 months.

"kbutterly" <kb*******@yahoo.comwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
Good morning,

I have seen two different types of data access layers and I am
wondering which, if either, is considered best practice, or if one is
better suited to certain situations than the other.

The first type is the DAL described in this MSDN article as well as in
the tutorial on the www.asp.net website:
http://msdn2.microsoft.com/en-us/library/
aa581778.aspx#aspnet_tutorial01_dataaccesslayer_vb _topic3

This first type uses typed datasets to build a DAL and then creates a
Business Logic Layer made up of classes that access the table adapters
from the DAL. This type has the names of the stored procedures in the
DAL.

The second type uses a class to wrap all the database connection code
and that class is the data access layer. Then the BLL calls this
class to handle database operations. This type has the BLL pass the
names of the stored procedure to the DAL as a parameter.

I see these as two fundamentally different ways to handle three-tier
architechture. Is one considered more robust? I can see that the
second type would have a very reusable DAL if it was designed
properly.

Any comments, references, links, war stories, would be greatly
appreciated.

Thanks,
Kathryn

Jan 30 '07 #3
Sloan,

Thanks so much for all the info; I have already printed out the msdn
article to read tonight!

Thanks again,
Kathryn

On Jan 30, 2:04 pm, "sloan" <s...@ipass.netwrote:
///
The second type uses a class to wrap all the database connection code
and that class is the data access layer. Then the BLL calls this
class to handle database operations. This type has the BLL pass the
names of the stored procedure to the DAL as a parameter.

////

This is when people use some helper class....as their DAL. this is
deficient in my opinion.
The helper is NOT the DAL. it ~~helps the DAL. That's where some make the
mistake.

Read my article:
5/24/2006
Custom Objects/Collections and Tiered Developmenthttp://sholliday.spaces.live.com/blog/

Where I outline some issues that you typically find. Alot of people throw
around the terms "layer" "data access layer" "tiers" etc, but its not always
well understood.

The goal of your DAL is to isolate you from the RDBMS you are using.

In my world, the dal returns
DataSets
IDataReaders
void/nothing
a scalar value
and nothing else.

................
We'll call this option #3 since its not really what others are doing.

I'm not a table adapter person.

.

Also, read my posthttp://groups.google.com/groups/search?q=%22class+EmployeeDataViaAcce...
go to the first hit, and find my entry:

Date: Mon, 20 Nov 2006 23:03:29 -0500
Local: Mon, Nov 20 2006 11:03 pm

that's if you think you're writing a DAL, which sometimes will hit one db,
and sometimes hit another one.

Here is another good example at:http://groups.google.com/group/micro...framework.adon...
(first hit)

And, in my blog I show this
And a reference to read from start to finish, aka, very informative for a
bird's eye view:
*http://msdn.microsoft.com/library/de...ary/en-us/dnbd...

I read that thing about every 4 months.

"kbutterly" <kbutte...@yahoo.comwrote in message

news:11**********************@s48g2000cws.googlegr oups.com...
Good morning,
I have seen two different types of data access layers and I am
wondering which, if either, is considered best practice, or if one is
better suited to certain situations than the other.
The first type is the DAL described in this MSDN article as well as in
the tutorial on thewww.asp.netwebsite:
http://msdn2.microsoft.com/en-us/library/
aa581778.aspx#aspnet_tutorial01_dataaccesslayer_vb _topic3
This first type uses typed datasets to build a DAL and then creates a
Business Logic Layer made up of classes that access the table adapters
from the DAL. This type has the names of the stored procedures in the
DAL.
The second type uses a class to wrap all the database connection code
and that class is the data access layer. Then the BLL calls this
class to handle database operations. This type has the BLL pass the
names of the stored procedure to the DAL as a parameter.
I see these as two fundamentally different ways to handle three-tier
architechture. Is one considered more robust? I can see that the
second type would have a very reusable DAL if it was designed
properly.
Any comments, references, links, war stories, would be greatly
appreciated.
Thanks,
Kathryn- Hide quoted text -

- Show quoted text -

Jan 30 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cmo63126 | last post by:
I'm currently refactoring a small to mid-size web application. One of my goals is to keep my layers as loosely coupled as possible. I've created 3 separate assemblies (Web GUI, Business Logic,...
3
by: Simon Harvey | last post by:
Hi everyone, I am in the process of making a small application and in the process of designing and implementing it, I have come accross a sort of general design related question. I'm using...
1
by: Jim McDermott | last post by:
A client I provide lan support to posed a web app question I'm not qualified to answer.... They build OEM mechanisms to order from an assortment of stock parts - I know this is a stretch, but...
7
by: News | last post by:
Hello, I have to build a program with the future in mind and I need a bit of guidance from a guru or two. My program will start as a multi-user Windows Application built with VB.Net and using an...
15
by: dn | last post by:
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a business layer, a data access layer, and a SQL Server 2005 database, and I have a question. In the business and data...
2
by: russell.lane | last post by:
I'm building out a pretty standard n-tier web application. The stack includes application/presentation, biz logic, and data access layers on top of an SQL server back end. We want to use...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
1
by: Griff | last post by:
Hi I'm not sure of the best way to go about achieving my goal and would appreciate any advice. What I would like to do is to generate a control that can be dropped onto a web page. For...
12
by: Rowan | last post by:
Hi there, I am just starting in .net 2.0 with a background in VB6. I have two projects to complete. The first being a website and the second is a client application. For now the majority of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.