473,385 Members | 1,752 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,385 software developers and data experts.

Collections and database

Hey folks,

Im working on a project, and of course am modelling the objects with
the database later in mind. I have a question about collections and
how they should be best used. Lets take for instance, a skus
collection, containing a bunch of sku objects. If I were to display a
grid containing all the skus, would it make much sense to load all the
skus into the collection first? Im not sure how a collection would be
useful in this sense, and would actually be more memory hungry. What
I am thinking is to simply go straight from DB to grid, skipping the
object loading. But this being the case, I feel like I am completely
disregarding the purpose of the collection object.

I appreciate your thoughts. So many ways to skin a cat, but only a
few of those ways actually skin the cat *well*. (sorry to all cat
lovers) ;)

Jul 15 '07 #1
4 1401

"xlar54" <sc**********@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
Hey folks,

Im working on a project, and of course am modelling the objects with
the database later in mind. I have a question about collections and
how they should be best used. Lets take for instance, a skus
collection, containing a bunch of sku objects. If I were to display a
grid containing all the skus, would it make much sense to load all the
skus into the collection first? Im not sure how a collection would be
useful in this sense, and would actually be more memory hungry. What
I am thinking is to simply go straight from DB to grid, skipping the
object loading. But this being the case, I feel like I am completely
disregarding the purpose of the collection object.
If you're using a dataset, an arraylist of objects or collection of
objects, each one is going to be a representation of data in memory no
matter how you look at it.

You load the dataset, arraylist, or collection with all the data.

Loading a strong type collection of objects is pretty simple, and the use
of the strong typed collection of objects is more powerful, gives better
control and is more easy to use, IMHO.

You can manipulate that data in the objects with properties and methods
within the object along with methods within the collection, when binding the
collection to the datagrid.
..

Jul 16 '07 #2
On Jul 15, 8:59 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"xlar54" <scott.hut...@gmail.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
Hey folks,
Im working on a project, and of course am modelling the objects with
the database later in mind. I have a question about collections and
how they should be best used. Lets take for instance, a skus
collection, containing a bunch of sku objects. If I were to display a
grid containing all the skus, would it make much sense to load all the
skus into the collection first? Im not sure how a collection would be
useful in this sense, and would actually be more memory hungry. What
I am thinking is to simply go straight from DB to grid, skipping the
object loading. But this being the case, I feel like I am completely
disregarding the purpose of the collection object.

If you're using a dataset, an arraylist of objects or collection of
objects, each one is going to be a representation of data in memory no
matter how you look at it.

You load the dataset, arraylist, or collection with all the data.

Loading a strong type collection of objects is pretty simple, and the use
of the strong typed collection of objects is more powerful, gives better
control and is more easy to use, IMHO.

You can manipulate that data in the objects with properties and methods
within the object along with methods within the collection, when binding the
collection to the datagrid.
.

Interesting. I never really thought of it like that. The dataset
itself being a collection, it really doesnt matter, and of course
there is benefit to using my own collection class instead of a generic
dataset. Thanks for the feedback.
Jul 16 '07 #3
On Sun, 15 Jul 2007 21:59:36 -0400, "Mr. Arnold" <MR. Ar****@Arnold.com>
wrote:
>
"xlar54" <sc**********@gmail.comwrote in message
news:11**********************@k79g2000hse.googleg roups.com...
>Hey folks,

Im working on a project, and of course am modelling the objects with
the database later in mind. I have a question about collections and
how they should be best used. Lets take for instance, a skus
collection, containing a bunch of sku objects. If I were to display a
grid containing all the skus, would it make much sense to load all the
skus into the collection first? Im not sure how a collection would be
useful in this sense, and would actually be more memory hungry. What
I am thinking is to simply go straight from DB to grid, skipping the
object loading. But this being the case, I feel like I am completely
disregarding the purpose of the collection object.

If you're using a dataset, an arraylist of objects or collection of
objects, each one is going to be a representation of data in memory no
matter how you look at it.

You load the dataset, arraylist, or collection with all the data.

Loading a strong type collection of objects is pretty simple, and the use
of the strong typed collection of objects is more powerful, gives better
control and is more easy to use, IMHO.

You can manipulate that data in the objects with properties and methods
within the object along with methods within the collection, when binding the
collection to the datagrid.
As Mr Arnold pointed out, you have to load something. A strongly typed
collection such as a List<T(or other generic list) uses fewer
resources than a Dataset but even a Datatable uses less resources than a
Dataset. And.., a Dataset is the 'natural' ( simplest ) way that asp.net
uses to do this kind of thing. One advantage of a Dataset/Datatable is
that the Ado.Net methods for sorting and filtering are already there but
with a collection you need more code to do those things.
Jul 16 '07 #4
<snipped>
Dataset. And.., a Dataset is the 'natural' ( simplest ) way that asp.net
uses to do this kind of thing.
I'll just point out that an ADO.Net Dataset can be used by ASP, Windows,
Console Application and NT Service .Net solutions, not limited to ASP.NET.

And in addition to this, if working or developing .Net N-tier solutions,
most likely, a collection is going to be used to cross tier boundaries.


Jul 16 '07 #5

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

Similar topics

1
by: Chris Leffer | last post by:
Hi. I have an asp.net application running on a Windows 2003/IIS 6 machine. After restart IIS I followed some performance counters from .NET to have an idea of the memory use by the application....
0
by: Gavin | last post by:
I am using collections in my project and have come up against some issues. My project is a web based thin client application. The main issue I have is with collections, I have all the users...
3
by: Guy Dillen | last post by:
Instead of using DataSets i want to implement an objects collection (in C#). E.g. a class Person and the instances are stored in a collection of Persons. So there is a layer that does the database...
3
by: aa7im | last post by:
I am trying to design a good domain model for a system I am working on but I am having a hard time trying to figure out how to deal with relations and transaction... For example if I create an...
3
by: Rob Thomas | last post by:
Hi, I've been tasked to come up with a new architecture for a large application at one of my customer's sites. In the past, I have developed multi-tier applications whereby the business...
3
by: ECathell | last post by:
Collections are really kicking me hard. I have a class Box. It has 3 properties(Boxtype,BoxTare,BoxDescription) I also want to make a BoxCollection object. I have tried using collectionbase...
4
by: John Dalberg | last post by:
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...
0
by: guy | last post by:
vb2005 is there a way of assigning multiple collections to be the datasource for a grid? eg suppose i have a database with People and PhoneNumbers tables and a PeoplePhoneNumbers link table ...
28
by: walterbyrd | last post by:
Python seems to have a log of ways to do collections of arbitrary objects: lists, tuples, dictionaries. But what if I want a collection of non-arbitrary objects? A list of records, or something...
3
by: Scott Stark | last post by:
Hello, I'm trying to get a better handle on OOP programming principles in VB.NET. Forgive me if this question is sort of basic, but here's what I want to do. I have a collection of Employee...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.