473,883 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creating DAL, how????

Hey

ASP.NET 2.0

I'm designing the DAL (Data Access Layer) of my web application. I want
every table to have a strongly typed object as wrapper arround the table. So
that for example if the DAL found 3 records in the table then it sends a
generic collection of 3 objects to the BLL (Business Logic Layer).

But here is the problem:
What if I need to do a select like this (combining data from multiple
tables):
select field_1, field_2, field_3 from table_1, table_2

As far as I know I cannot just use the table wrapper as I mentioned above on
this select, because some of the fields are from a different table. Should I
just create a new strongly typed object for this select or could I use the
wrapper objects I mentioned above, or what do you suggest????

Jeff
Mar 2 '07 #1
13 2080
On Mar 2, 9:40 pm, "Jeff" <it_consulta... @hotmail.com.NO SPAMwrote:
this select, because some of the fields are from a different table. Should I
just create a new strongly typed object for this select
yes,

maybe you can read this tutorial at http://msdn2.microsoft.com/en-us/library/aa581778.aspx

I think it's really useful

This one is good too
http://msdn2.microsoft.com/en-us/library/ms978510.aspx
Mar 2 '07 #2
"Jeff" <it************ @hotmail.com.NO SPAMwrote in message
news:uP******** *****@TK2MSFTNG P06.phx.gbl...
I'm designing the DAL (Data Access Layer) of my web application. I want
every table to have a strongly typed object as wrapper arround the table.
So that for example if the DAL found 3 records in the table then it sends
a generic collection of 3 objects to the BLL (Business Logic Layer).

But here is the problem:
What if I need to do a select like this (combining data from multiple
tables):
select field_1, field_2, field_3 from table_1, table_2

As far as I know I cannot just use the table wrapper as I mentioned above
on this select, because some of the fields are from a different table.
Should I just create a new strongly typed object for this select or could
I use the wrapper objects I mentioned above, or what do you suggest????
You've hit the nail on the head...

Opinions vary on this, but it's my opinion that a DAL should be as light as
possible and should UNDER NO CIRCUMSTANCES make reference to individual
databases or tables. If you do this, every time you modify your schema,
you'll need to modify your DAL! My DAL is based very closely on the
Microsoft DAAB and, being so, means that it can be dropped into any VS.NET
project (WinForms or WebForms) with absolutely no modification whatever.

From your description it sounds very much as though your DAL is more of a
mixture / combination of business layer and data abstraction layer - I'd
strongly urge you to rethink this...
Mar 2 '07 #3
Thank you for that great tip about Microsoft DAAB, I didn't know about it.
I've googled and came across some articles which I will read of the subject.
If you have any great links about DAAL, maybe you could post some of them
here?
"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
"Jeff" <it************ @hotmail.com.NO SPAMwrote in message
news:uP******** *****@TK2MSFTNG P06.phx.gbl...
>I'm designing the DAL (Data Access Layer) of my web application. I want
every table to have a strongly typed object as wrapper arround the table.
So that for example if the DAL found 3 records in the table then it sends
a generic collection of 3 objects to the BLL (Business Logic Layer).

But here is the problem:
What if I need to do a select like this (combining data from multiple
tables):
select field_1, field_2, field_3 from table_1, table_2

As far as I know I cannot just use the table wrapper as I mentioned above
on this select, because some of the fields are from a different table.
Should I just create a new strongly typed object for this select or could
I use the wrapper objects I mentioned above, or what do you suggest????

You've hit the nail on the head...

Opinions vary on this, but it's my opinion that a DAL should be as light
as possible and should UNDER NO CIRCUMSTANCES make reference to individual
databases or tables. If you do this, every time you modify your schema,
you'll need to modify your DAL! My DAL is based very closely on the
Microsoft DAAB and, being so, means that it can be dropped into any VS.NET
project (WinForms or WebForms) with absolutely no modification whatever.

From your description it sounds very much as though your DAL is more of a
mixture / combination of business layer and data abstraction layer - I'd
strongly urge you to rethink this...

Mar 2 '07 #4
If you want to do the kind of ORM classes that you refer to, you'll need to
use one of the frameworks that generates "wrapper" classes that provide for
things like programmatic Joins. I know there are some CodeSmith templates
that can generate this type of code, but frankly, unless you really know what
you are doing the learning curve to get there could be pretty steep.
Peter

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


"Jeff" wrote:
Hey

ASP.NET 2.0

I'm designing the DAL (Data Access Layer) of my web application. I want
every table to have a strongly typed object as wrapper arround the table. So
that for example if the DAL found 3 records in the table then it sends a
generic collection of 3 objects to the BLL (Business Logic Layer).

But here is the problem:
What if I need to do a select like this (combining data from multiple
tables):
select field_1, field_2, field_3 from table_1, table_2

As far as I know I cannot just use the table wrapper as I mentioned above on
this select, because some of the fields are from a different table. Should I
just create a new strongly typed object for this select or could I use the
wrapper objects I mentioned above, or what do you suggest????

Jeff
Mar 2 '07 #5
On Mar 2, 10:45 pm, "Mark Rae" <m...@markNOSPA Mrae.comwrote:
"Jeff" <it_consulta... @hotmail.com.NO SPAMwrote in message

news:uP******** *****@TK2MSFTNG P06.phx.gbl...
I'm designing the DAL (Data Access Layer) of my web application. I want
every table to have a strongly typed object as wrapper arround the table.
So that for example if the DAL found 3 records in the table then it sends
a generic collection of 3 objects to the BLL (Business Logic Layer).
But here is the problem:
What if I need to do a select like this (combining data from multiple
tables):
select field_1, field_2, field_3 from table_1, table_2
As far as I know I cannot just use the table wrapper as I mentioned above
on this select, because some of the fields are from a different table.
Should I just create a new strongly typed object for this select or could
I use the wrapper objects I mentioned above, or what do you suggest????

You've hit the nail on the head...

Opinions vary on this, but it's my opinion that a DAL should be as light as
possible and should UNDER NO CIRCUMSTANCES make reference to individual
databases or tables. If you do this, every time you modify your schema,
you'll need to modify your DAL! My DAL is based very closely on the
Microsoft DAAB and, being so, means that it can be dropped into any VS.NET
project (WinForms or WebForms) with absolutely no modification whatever.

From your description it sounds very much as though your DAL is more of a
mixture / combination of business layer and data abstraction layer - I'd
strongly urge you to rethink this...
A DAL can be based on the DAAB, but a DAL is not the DAAB

Of course, if you don't have the separated machines or multiple DBs it
make no sense to make an application complicated by DAL...

Mar 2 '07 #6
"Alexey Smirnov" <al************ @gmail.comwrote in message
news:11******** ************@s4 8g2000cws.googl egroups.com...
Of course, if you don't have the separated machines or multiple DBs it
make no sense to make an application complicated by DAL...
Indeed! An application should be simplified, not complicated, by a DAL...
Mar 3 '07 #7
Yeah, DAL is not the DAAB... I thought it was the same, but that was before
I had read some of the articles I came across on internet about DAAB
"Alexey Smirnov" <al************ @gmail.comwrote in message
news:11******** ************@s4 8g2000cws.googl egroups.com...
On Mar 2, 10:45 pm, "Mark Rae" <m...@markNOSPA Mrae.comwrote:
>"Jeff" <it_consulta... @hotmail.com.NO SPAMwrote in message

news:uP******* ******@TK2MSFTN GP06.phx.gbl...
I'm designing the DAL (Data Access Layer) of my web application. I want
every table to have a strongly typed object as wrapper arround the
table.
So that for example if the DAL found 3 records in the table then it
sends
a generic collection of 3 objects to the BLL (Business Logic Layer).
But here is the problem:
What if I need to do a select like this (combining data from multiple
tables):
select field_1, field_2, field_3 from table_1, table_2
As far as I know I cannot just use the table wrapper as I mentioned
above
on this select, because some of the fields are from a different table.
Should I just create a new strongly typed object for this select or
could
I use the wrapper objects I mentioned above, or what do you suggest????

You've hit the nail on the head...

Opinions vary on this, but it's my opinion that a DAL should be as light
as
possible and should UNDER NO CIRCUMSTANCES make reference to individual
databases or tables. If you do this, every time you modify your schema,
you'll need to modify your DAL! My DAL is based very closely on the
Microsoft DAAB and, being so, means that it can be dropped into any
VS.NET
project (WinForms or WebForms) with absolutely no modification whatever.

From your description it sounds very much as though your DAL is more of a
mixture / combination of business layer and data abstraction layer - I'd
strongly urge you to rethink this...

A DAL can be based on the DAAB, but a DAL is not the DAAB

Of course, if you don't have the separated machines or multiple DBs it
make no sense to make an application complicated by DAL...

Mar 3 '07 #8
ORM classes? -what is ORM acronym for?
"Peter Bromberg [C# MVP]" <pb*******@yaho o.yabbadabbadoo .comwrote in
message news:1D******** *************** ***********@mic rosoft.com...
If you want to do the kind of ORM classes that you refer to, you'll need
to
use one of the frameworks that generates "wrapper" classes that provide
for
things like programmatic Joins. I know there are some CodeSmith templates
that can generate this type of code, but frankly, unless you really know
what
you are doing the learning curve to get there could be pretty steep.
Peter

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


"Jeff" wrote:
>Hey

ASP.NET 2.0

I'm designing the DAL (Data Access Layer) of my web application. I want
every table to have a strongly typed object as wrapper arround the table.
So
that for example if the DAL found 3 records in the table then it sends a
generic collection of 3 objects to the BLL (Business Logic Layer).

But here is the problem:
What if I need to do a select like this (combining data from multiple
tables):
select field_1, field_2, field_3 from table_1, table_2

As far as I know I cannot just use the table wrapper as I mentioned above
on
this select, because some of the fields are from a different table.
Should I
just create a new strongly typed object for this select or could I use
the
wrapper objects I mentioned above, or what do you suggest????

Jeff

Mar 3 '07 #9
"Jeff" <it************ @hotmail.com.NO SPAMwrote in message
news:u9******** ******@TK2MSFTN GP03.phx.gbl...
Yeah, DAL is not the DAAB... I thought it was the same, but that was
before I had read some of the articles I came across on internet about
DAAB
Sounds like you're heading in the right direction... :-)
Mar 3 '07 #10

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

Similar topics

2
2726
by: rdsteph | last post by:
Python411 is a series of podcasts about Python, aimed at hobbyists and others who are learning Python. Each episode focuses on one aspect of learning Python, or one kind of Python programming, and points to online tools and tutorials. Python related news and events will also be reported upon. This podcast series will probably not be of much interest to expert or professional programmers. I am a hobbyist and am not qualified nor capable...
6
6131
by: owen | last post by:
Generally speaking, what does it mean when I see a "button" with red text showing this message instead of the control I've dragged onto the web form in Design View.? (But the page works fine at runtime). Does it indicate a problem with References for example? Thanks Owen PS. replies cc'd by email appreciated. owen.southwood@mantix.com
2
2162
by: Pawan | last post by:
Hi Guys, I have this current assignment where I have to develop online forms for local municipal authorities. I have to use adobe acrobat to create online forms from PDFs (which I have never done before and have no idea how to do it). Now these online forms will be shared by 1200 users. VB and ASP will be used as glueware for the writing/coding. For eg, we will be creating navigation pages in ASP & linking into adobe. Any resource on this...
15
6755
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use javascript or vbscript it works. I will appreciate any help. I do the following (C#):
2
3781
by: LIN | last post by:
Hello, Greetings. I am creating a web site which will contain lot of articles. I had been planning to create simple HTML page on the server everytime i posted a article (eg. article12.html ). Now, i want to show an advertisement on top of each of this html page. the ad banner has to be dynamically updated depending on date (period) the advertiser has planned to advertise for. So I thought of creating ASPx pages instead. Is it a good...
2
4576
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is easy, but 1) How do I set about dynamically creating user controls (like TextBox, TextArea) --- simply Declare and initialised (new) the user controls?? How do I "place" it graphically on the form. Ideally, I want them to lay out in a table, one...
0
2139
by: Ravi Ambros Wallau | last post by:
Hi: I've created a custom control - a grid that uses Infragistics to display some filters, the grid itself, and some buttons. Well, when using this control directly on WebForm, everything works really fine. No problems at all. But, when this control is placed inside a template of an Infragistics UltraWebTab control, somethings stranges happens: 1. When the WebForm is opened, an "Error Creating Control" message is displayed (for container...
12
3186
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without restarting the application. What I did was to create an AppDomain that loaded the plugins and everything was great, until I tried to pass something else that strings between the domains...
15
2845
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. Everything is the default settings I believe. IIS is running under Local System. In IIS the DefaultAppPool is running under Network Service. Annonymous access uses the account IUSR_JASMINE (machine name is Jasmine).
9
2997
by: =?Utf-8?B?YmJn?= | last post by:
Hi all, I read somewhere "using kernel stuff in thread is not good.." if ManualResetEvent object is created in thread but not actually used, will it affect performance? Bob
0
9942
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10416
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9574
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7971
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7129
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5797
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5991
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4220
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3233
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.