DataSet to a Custom Collection object

  • Thread starter Thread starter npaulus
  • Start date Start date
N

npaulus

Hi,

DataSets are usually resource heavy. Instead of having to pass them
from my middle tier to my presentation layer I was wondering if anyone
has developed a custom collection object that is less resource heavy
and can be passed lightweight to the presentation layer.

Thanks,
NJ
 
How are u going to bind your custom object to the controls in UI?
Using DataSet/DataTables or what? It that case why not to serizalize DataSet
binary to diminish resources sending between layers?
DataSets are usually resource heavy. Instead of having to pass them
from my middle tier to my presentation layer I was wondering if anyone
has developed a custom collection object that is less resource heavy
and can be passed lightweight to the presentation layer.

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
If you are in 1 app-domain, then this is a false saving - in fact you are
making things significantly worse. This does apply if the two are separated
e.g. by a web-reference, though.

Perhaps a simpler option is to use a proper class to represent the data, and
then use MyClass[], List<MyClass>, Collection<MyClass> or whatever.

Marc
 
Forgot to add; you can data-bind to any object in 2.0 that uses properties
and the property change notification interface; it even has full designer
support - not that I trust it: I've seen it ditch pages too many times...

Marc
 
You can use any kind of custom object collection to pass the data to your
presentation layer. The problem you will run into is when you attempt to
bind the collection to controls. For that you will need a collection that
implements several standard interfaces (IEditable Object and others
depending on whether you need to do sorting and filtering in the UI
controls).

I use List<CustomObject> to pass the data to the presentation layer and I
then convert it to a BindingListView to bind it to controls. Take a look at
Brian Noyes book on Binding Data to Windows Forms 2.0 for more details on
that:
http://book.itzero.com/read/microso...T.Jan.2006_html/032126892X/ch09lev1sec12.html
 
Hi,

Michael Nemtsev said:
How are u going to bind your custom object to the controls in UI?
Using DataSet/DataTables or what? It that case why not to serizalize
DataSet
binary to diminish resources sending between layers?

You can bind to any collection.
The serialization is an isssue though.

The most important performance improvement I found when I migrated one app
from using Dataset to use object collection was due to boxing/unboxing . It
improved almost 50% in some tight loops !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top