473,804 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datasets vs. OOP

I've seen an Introduction on ADO.NET with its Datasets on .NET TV and Iam
now wondering how it is realized/used in real world applications.

I don't believe that one would create a dataset and add relations to it and
so on for every table in the application, this would be a real mess and this
has nothing to do with OOP.

Normally, would would create a class Customer, a class Invoices, Positions,
Articles and so on.
But how can this be realized using Datasets? Datasets and encapsulating data
+ hiding implemention in classes seems to be a contradiction to me.

Sorry for me stupidness but I found no example explaining this.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Jul 21 '05
45 2456
Alfredo wrote:
On Mon, 10 May 2004 06:07:58 -0700, "Frans Bouma [C# MVP]"
<pe************ ******@xs4all.n l> wrote:
There is no n-tier 'law', so saying it is about physical tiers is IMHO
your interpretation, not 'the' interpretation, because there is none.


You could say the same about almost everything in the IT world.

But n-tier systems have two logical tiers: Client and server.


but the BL is a client of the DAL and a server to the GUI client tier :),
that's why I was saying, the differences in tiers are semantical, not
necessarily client/server

FB

--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
Jul 21 '05 #31
Alfredo wrote:
On Mon, 10 May 2004 08:14:46 -0400, "William Ryan eMVP"
<do********@com cast.nospam.net > wrote:
Unfortunately many OO practicioners use the obsolete Network Model.

There are a lot of toerh misaaplications of OOP that are far more complex
than just this issue.


But this is an important issue IMO. For instance O/R mappers are tools
intended to apply the Network approach misusing the DBMSs as mere
storage mechanisms.


I don't think every O/R mapper does that, only the ones following
Fowler/Evans' Domain model. (note: I don't follow that approach)

FB

--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
Jul 21 '05 #32
Alfredo wrote:
On Mon, 10 May 2004 06:16:37 -0700, "Frans Bouma [C# MVP]"
<pe************ ******@xs4all.n l> wrote:
Agreed. The relational model is 'weak' when you look at it from an OO
POV:


Striking statement!

The Relational Model is the direct application of thousands of years
of accumulated knowledge in math and logic. It is the direct
application of Predicate Logic and Set Theory. Disciplines developed
by people like Aristotle, Boole, Cantor, Frege, Godel, Rusell, etc.
The Relational Model is a very solid mathematical framework.


I think that is a bit too much. Codd did most of the work, and before that,
there was mathematical theory, but not applyable to databases directly.
Agreed, most theoretical basis is founded way before Codd walked the earth,
but I find it a bit too much to give ancient mathematicans the credit for the
relational model ;)
you can't model inheritance for example without check constraints or even
values in tables.


I am afraid that what you mean is not inheritance at all.


( <- == is-a )

Person <- Employee <- Manager <- CEO
Person <- Employee <- Clerk
Person <- Employee <- Accountant

Now, if you set this up in NIAM or ORM (Halpin) you will use
supertypes/subtypes and which allow you to define relations directly to
'Manager' for example.

When you want to project this onto a relational model, you can't define is-a
relationships or supertype/subtypes. You can 'try', but it is very hard.
Nijssen/Halpin mention 2 ways:
1) flatten the supertype/subtype hierarchy and store them all in 1 table,
with all attributes of all types in the hierarchy in that table, and
attributes which are defined with a lower type than the root supertype are
nullable. Furthermore, add a column which identifies the type of the entity
in a particular row.
2) define 1 table per subtype and add an FK constraint from the PK of the
subtype table to the PK of its supertype table (not THE supertype table!)

1) requires values in its type column to interpret which type the row really
has. This is thus not modelable in the relational model: without data in that
column, there is no hierarchy, and the hierarchy is in the data, not in the
model. In other words you can't model inheritance this way, even though it IS
inheritance.
2) is close, however it doesn't symbolizes a hierarchy per se, because the FK
constraint just illustrates 'relationship between attributes' not an is-a
relationship. Retrieving a complete 'type' requires reads from 1 (person) or
more tables (rest), which is not modelable: I can read a row from 'Manager'
without the necessity to read its related row in Employee: i.e. the rows are
related but not seen as a unit, while we do see them as a unit in our
abstract supertype/subtype hierarchy.
FB

--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
Jul 21 '05 #33
On Mon, 10 May 2004 10:28:51 -0500, "Earl" <brikshoe<at>co mcast<.>net>
wrote:
Are we trolling Alfredo ;=)
No.
I have never read anything anywhere that a
reputable source would claim that the concept of "n-tier" had much if
anything to do with physical tiers.
I don't know any reputable source who writes about n-tiers. It is all
very weak.
Most folks would consider the term
"n-tier" in the context of separating the business layer from the user and
data layers.
A nonsense. It is impossible to separate the business layer from the
database layer because they are the same. What is possible is to
separate the logical database layer from the storage mechanism and
DBMSs are intended to do that.

An Application Server is nothing but a DBMS that uses another DBMS
behind the scenes as the storage mechanism. Then we have again a
client and a server. The backend DBMS used for storage is an
implementation detail. It is "encapsulat ed" and out of the logical
level.
Since those might be physically implemented all on the same
machine, "n-tier" is clearly a term to describe a logical implementation.
No, you may have many physical tiers in the same machine.
But a client-server relationship is "n-tier" also


Of course, a client-server system may have many physical tiers. If
they have more than 2 they are called "n-tier" systems.
Regards
Alfredo
Jul 21 '05 #34
On Mon, 10 May 2004 11:30:21 -0400, "William Ryan eMVP"
<do********@com cast.nospam.net > wrote:
Let's back way up here b/c this discussion is turning into something totally
different than the original question.
Something very frequent in the newsgroups.
As such, DataSets have NOTHING to do with Relational theory.
This is unfortunately true.
They may
appear to model it, they may appear to copy it's functionality, they may
even implement many of the rules, but they aren't necessarily RDBMS
structures or anything of the sort.
Nobody said the contrary. It is clear that datasets are intended to
map SQL databases, but you can do all you want with them.
To this end, I could easily employ datasets and say to hell with Relational
theory, Network model etc and still have a valid design.


Of course, but to use a network design in the 21 century does not make
a lot of sense.
Regards
Alfredo
Jul 21 '05 #35
On Mon, 10 May 2004 08:36:43 -0700, "Frans Bouma [C# MVP]"
<pe************ ******@xs4all.n l> wrote:
But this is an important issue IMO. For instance O/R mappers are tools
intended to apply the Network approach misusing the DBMSs as mere
storage mechanisms.
I don't think every O/R mapper does that, only the ones following
Fowler/Evans' Domain model.


Which ones don't?

I only know these O/R mappers.
(note: I don't follow that approach)


Good for you!

Regards
Alfredo
Jul 21 '05 #36
On Mon, 10 May 2004 08:33:42 -0700, "Frans Bouma [C# MVP]"
<pe************ ******@xs4all.n l> wrote:
But n-tier systems have two logical tiers: Client and server.


but the BL is a client of the DAL and a server to the GUI client tier :),


But the DAL does not exist for the GUI. It is hidden or encapsulated.
That's why I said that there are only two visible logical layers.

In the case of a distributed DBMS is the same. A properly designed
distributed database should appear to the clients as a single
database. Client-Server again.
Regards
Alfredo
Jul 21 '05 #37
Alfredo wrote:
On Mon, 10 May 2004 08:33:42 -0700, "Frans Bouma [C# MVP]"
<pe************ ******@xs4all.n l> wrote:
But n-tier systems have two logical tiers: Client and server.
but the BL is a client of the DAL and a server to the GUI client tier :),


But the DAL does not exist for the GUI. It is hidden or encapsulated.
That's why I said that there are only two visible logical layers.


You can have multiple tiers at the same tier level, hidden by a facade,
however the facade calls into different tiers.
In the case of a distributed DBMS is the same. A properly designed
distributed database should appear to the clients as a single
database. Client-Server again.


however these 'clients' are servers for other clients. So strictly thinking
in 'client' and 'server' is not that great. Better is: 'consumer-role' and
'producer-role' in a given 'situation'.

FB
--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
Jul 21 '05 #38
Alfredo wrote:
On Mon, 10 May 2004 08:36:43 -0700, "Frans Bouma [C# MVP]"
<pe************ ******@xs4all.n l> wrote:
But this is an important issue IMO. For instance O/R mappers are tools
intended to apply the Network approach misusing the DBMSs as mere
storage mechanisms.
I don't think every O/R mapper does that, only the ones following
Fowler/Evans' Domain model.


Which ones don't?


mine :)
I only know these O/R mappers.


O/R mappers are IMHO for solving overhead code: how to work with data with
OO constructs. You need overhead code to make that happen.

FB

--
Get LLBLGen Pro, the new O/R mapper for .NET: http://www.llblgen.com
My .NET Blog: http://weblogs.asp.net/fbouma
Microsoft C# MVP
Jul 21 '05 #39

"Alfredo" <al*****@nospam .es> wrote in message
news:40******** *******@msnews. microsoft.com.. .
On Mon, 10 May 2004 11:30:21 -0400, "William Ryan eMVP"
<do********@com cast.nospam.net > wrote:
Let's back way up here b/c this discussion is turning into something totallydifferent than the original question.
Something very frequent in the newsgroups.
As such, DataSets have NOTHING to do with Relational theory.


This is unfortunately true.
They may
appear to model it, they may appear to copy it's functionality, they may
even implement many of the rules, but they aren't necessarily RDBMS
structures or anything of the sort.


Nobody said the contrary. It is clear that datasets are intended to
map SQL databases,

I respectfully disagree. If their intended purpose was to map back to SQL
databases, then what explains the tremendous support for XML and the fact
that you don't need to use a DB at all? It's a datasource that they are
meant to map back to, and that datasource can be a flat file, csv etc.

If they are clearly intended to map back to SQL Databases and aren't equally
intended to map to other data sources, then why can you use an Excel Sheet
or csv file, as flat and anti-sql as they get, Exactly like you would a SQL
DB, particularly in regard to the dataset. If anything you could make that
argument about a dataadapter, but again that's flawed because of the point I
just made.

If SQL Databases are the intended purpose, what explains the support for Web
Services, one of the highlights of ADO.NET that could write bits and pieces
of data to x number of hetergeneous data sources in part or in their
entirety? You could (and many do) write pieces of the Data retrieved form
th edataset ws for instance to an oracle/sql server/access db (which are all
obviously SQL) as well as HTML and XML Files which could be easily consumed
by say Infopath. I do it daily and it's in no way irregularl usage.

Moroever, you'll notice the word DataSource used extensively in the
documentation, not SQL Compliant Database. MS went through a good bit of
effort to draw this distinction precisely b/c it wanted to eliminate
confusion like this.

but you can do all you want with them.
To this end, I could easily employ datasets and say to hell with Relationaltheory, Network model etc and still have a valid design.
Of course, but to use a network design in the 21 century does not make
a lot of sense.


I wasn't saying it did..hence the statement Network model etc. I coudl opt
totally out of all of these particular models and used a declarative model
coupled with a any concept I want, I'm free to invent it for that matter..

Regards
Alfredo

Jul 21 '05 #40

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

Similar topics

0
2694
by: William Ryan | last post by:
At the risk of sounding like a Big 5 consultant, "It depends". 1) Strongly typed datasets rock, they are faster than untyped, use intellisense... but your reason for wanting to use them is important. I use them every day of my life, but I also don't use them every day of my life and there are reasons for both. 2) How much of your process is dependent on reads vs.
4
1738
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset objects to the frist few forms but then later I removed those and created these objects in my code. I now see 3 datasets in the Solution Explorer panel part but not all the datasets that I have in my codes. Are these 3 datasets leftover from the...
9
2918
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got answered... There are articles on the new TableAdapters where it says that a key new advantage is that a single TableAdapter, which can have multiple queries, can be used on multiple forms. Now that was in an article on using TableAdapters with...
16
1939
by: Luqman | last post by:
Is it recommended to use datasets in ASP.Net 2.0 / VS.Net 2005 ? Best Regards, Luqman
4
9924
by: Ronald S. Cook | last post by:
I've always used untyped datasets. In a Microsoft course, it walks through creating typed datasets and harps on the benefits. It has you drag all these things around ..wizard, wizard, wizard... code gen, code gen, code gen. What's at the end looks slick, but then there's a ton of generated code that I'm going to have to maintain now. I.e. I like typing things myself (don't like wizards) so I can know exactly what I've done.
25
2781
by: Penelope Dramas | last post by:
Hello, I'm in a front of very serious .net redesign/rewrite of an old VB6 application. I had been asked to make it .NET 2.0 and would like to ask couple of questions regarding data access as this application is heavily data-centric around MSDE database. Would it be better to use custom business objects or extend
2
1372
by: S.Tedeschi | last post by:
Hi all gurus. I'm trying to switch to VS 2005, from VS 2003. I've an ASP.NET 1.1 app heavily relying on StronglyTyped DataSets, with lots of FindByKey..., dataSet.Tablename, and similar methods. Converting to ASP.NET 2.0 leaves dataSets' classes unconverted, as stated by M$; what's worse, I'm not able to use converted dataSets, nor new ones, but just non- typed dataSets declared directly in pages (or code-behind), and so I'm not allowed...
0
1223
by: S.Tedeschi | last post by:
Hi all; as posted some days ago, I'm converting an on-line app; I used to heavily rely on strongly-typed DataSets directly dropped onto pages, and so viewed by code(-behind) as well. In the next two weeks I discovered that such objects are no more directly usable in pages, namely in DataGrid which don't see them any more. Even if rebuilt in Component Designer, and so visible in code, DataSets are invisible in Page Designer, so now it's...
12
3606
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a gridview, for example, I loop through a datareader, populating an array list with instances of a custom class in the middle tier, and then send the array list up to the presentation layer and bind the gridview to it. If I use a typed dataset, I...
9
1945
by: gardnern | last post by:
We have X number of data sets, of Y length each. For example... Small, Medium, Large and Red, Green, Blue, Yellow We need to generate a list of all possibilities Small Red
0
9706
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
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9152
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
7620
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
6853
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();...
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2991
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.