473,569 Members | 2,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Advantages of using custom collections over datatables to bind to a datagrid?

I noticed the starterkits timetracker & issue tracker load data from a
database into custom collections (arraylists) which bind to a datagrid.

What are the advantages of using custom collections over simpler objects
like datareaders or datatables?

John Dalberg
Dec 8 '05 #1
4 2128
In my mind it's because you actually get a business layer htat way (not
automatically, but it's the first right step), and thus get the potential
for greater reuse.

http://msdn.microsoft.com/asp.net/de...CustEntCls.asp

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"John Dalberg" <no****@nospam. sss> wrote in message
news:20******** ***********@new sreader.com...
I noticed the starterkits timetracker & issue tracker load data from a
database into custom collections (arraylists) which bind to a datagrid.

What are the advantages of using custom collections over simpler objects
like datareaders or datatables?

John Dalberg

Dec 8 '05 #2

give this a read:
http://msdn.microsoft.com/asp.net/de...CustEntCls.asp

Article is by Karl Seguin frequent contributor here and is very well
written. Really helped me out w/ custom collections which i use all the time
now.
"John Dalberg" <no****@nospam. sss> wrote in message
news:20******** ***********@new sreader.com...

I noticed the starterkits timetracker & issue tracker load data from a
database into custom collections (arraylists) which bind to a datagrid.

What are the advantages of using custom collections over simpler objects
like datareaders or datatables?

John Dalberg


Dec 8 '05 #3
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote:
In my mind it's because you actually get a business layer htat way (not
automatically, but it's the first right step), and thus get the potential
for greater reuse.

http://msdn.microsoft.com/asp.net/de...y/en-us/dnaspp
/html/CustEntCls.asp

Karl


What's your take on this person's reply to your article?
http://jelle.druyts.net/PermaLink.as...a-9462-71dae71
3539e

I am working on a new project. It's not complicated and performance and
scalability are non issues because few users are using it and on a limited
basis. While custom entities and collections are valid, it seems they will
need more time for me to code, debug and test.

Now I am interested in looking at sample apps which use datasets or
datatables between the layers. Any good dessigned sample apps out there
which favor datasets/tables?

John Dalberg
Dec 8 '05 #4
I plan on readdressing the issue in the future.

To summarize here for you however, the greatest complaints about my article
was that I compared custom entities/collections to UNTYPED datasets, as
opposed to Typed Dataset. I think those are totally valid complaints,
however, they missed the point of the article. In fairness, I think I wrote
it in such a way that it was _very_ easy to miss the point. I was trying to
make people think of their domain model, that is, creating a model in their
code that represents the particular domain they are working on. I don't
care what mechanism people use to do this, but I strongly feel that _a lot_
of developers still need to THINK about their code that way. That was my
goal, to try and change how they look at programming.

There are differences between typed datasets and custom entities (and the
other solutions) I have my preference, which is obvious :) But I'm a
happy guy if I got people thinking about a new dimension of their code, and
a VERY happy guy if I ever have to maintain/fix code that was built with
that viewpoint in mind - whatever specific implementation was used.

If you understand both implementations , and more important understand what
they are trying to do (which is the same thing), then you have all the
knowledge to pick the right one for your project/team!

As far as example, I actually don't know of any great example. As far as I
can remember, none of the start kits I've looked at use Typed DataSets (I'm
not saying there aren't any, but the 3 or 4 I've gone through didn't).

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"John Dalberg" <no****@nospam. sss> wrote in message
news:20******** ***********@new sreader.com...
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote:
In my mind it's because you actually get a business layer htat way (not
automatically, but it's the first right step), and thus get the potential
for greater reuse.

http://msdn.microsoft.com/asp.net/de...y/en-us/dnaspp
/html/CustEntCls.asp

Karl


What's your take on this person's reply to your article?
http://jelle.druyts.net/PermaLink.as...a-9462-71dae71
3539e

I am working on a new project. It's not complicated and performance and
scalability are non issues because few users are using it and on a limited
basis. While custom entities and collections are valid, it seems they will
need more time for me to code, debug and test.

Now I am interested in looking at sample apps which use datasets or
datatables between the layers. Any good dessigned sample apps out there
which favor datasets/tables?

John Dalberg

Dec 8 '05 #5

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

Similar topics

5
11185
by: Dalibor Kusic | last post by:
The DataTable contains, for example, only one column of lets say Person class. Person class has three fields, and a constructor that takes a single string and parses it over those three fields. Now, how do I modify the Person class (which interfaces to implement) so I can bind my DataTable to a DataGrid and then add, modify and delete...
2
2193
by: A Traveler | last post by:
Hi, I have a custom collection class i wrote, LineItemsCollection, which is a strongly typed collection of objects of my LineItem class. The LineItem class is a simple class with just a couple properties, ProdID, Description, Quantity and UPC. 3 strings and a long. The LineItemsCollection class inherits from...
1
1267
by: Luis Esteban Valencia | last post by:
Please everybody participate in this question. Hello my applicacion has many layers and classes and I think its well structured. PLease let me know if you disagree and why. 1. I have the user Interface (webforms) 2. I have a class Called Customer Class (it only has private fields, properties). Those properties connecto a Class called...
3
1211
by: Brian H | last post by:
I am looking for working examples of making use or 2 datagrids and one dataset Grid 1 master Display minimul info Grid 2 slave. Disply detail info When the user clicks a row on the master I then load Grid 2 with detail information. Thanks for any help B
3
1073
by: MTmace | last post by:
I have a dataset that was created from an xml file. That dataset has two tables. I would like to create a third datatable that brings some of the fields from each datatable together. Then I need to bind the newly created datatable to a datagrid. Is this the only way to do what I need? Is there a way to bind the datagrid to two different...
3
2078
by: Scottie_do | last post by:
I have a 20meg in-memory stack-based array and I'd like to normalise in the client's memory... then add foriegn keys, and display results on a datagrid. I discovered that converting the stack to a datatable my memory utilisation increases to 120 megs. (lots of overhead) Couple of questions 1)- Is that memory increase typical? All I want to...
1
1739
by: Mark Olbert | last post by:
Has anyone else noticed that the design-time support for databinding in custom controls in ASPNET2 sucks? At least for GridViews? So far I've spent going on two days trying to get the following simple statements to actually generate something at design-time: gridView = new GridView(); gridView.AutoGenerateColumns = true; ...
0
1143
by: w31chang | last post by:
Hi, I create custom entity objects, a custom collections for the entity objects and a custom object that acts like a collection of the custom entity collections which I called EntitySet Object. The EntitySet is used to bind the entity collections to windows form bindingsource in design time. After 2 weeks of bloody coding and reading really...
0
7694
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...
0
7609
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...
0
7921
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7666
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...
1
5504
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...
0
5217
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...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
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...

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.