which one return Typed datasets - OR - LIST<Address> generic type???

M

mesut

return Typed datasets or LIST<???> generic type???

a discussion question... guys..

this is the method how I work.
create for each entity or DB result a class in a class library folder
e.g. entity... Create a class .e.g Address in this folder and define
all the fields as properties
So when db returns Table I move the records in to my generic class.

e.g. table Address returns name, address, city, country.... Then I
create an class in a folder (entity) and define the 4 properties
( name, address, city, country)
so my class is a mirror of my table (returned fields)

when I read records from table I move all records in into this
instantiated List<Address> or Address object and return from my
factory method this way.

3 main reason:
- type safe (no troubles with int, string etc) and
- it promptes at the intellisence,
- I return objects and not tables or dataset so I'm independend to
any language platform... e.g. Java, php can knows objects so ILIST is
is good to move iso of linked to ADO.


But I get discussion with some people to not returning generic
ILISt... they think it's unnessary... They strongly encourage me to
use Typed Datasets. They also tell that there is
intellisence rpompted etc...

Well I havent't much experience with Typed Datasets... And as I told
it's too depended to ADO.NET. No outside programming languages knows
this...

What is your feeling? What would you use "Return Typed dataset" or
"Return Generics (class)" like List<Address> or Address


regarding performance:::: --> you don't really see the
difference...... Because it's cached.


any feedback is welcome??? Just intersted in your idea.
 
A

Arne Vajhøj

mesut said:
return Typed datasets or LIST<???> generic type???

a discussion question... guys..

this is the method how I work.
create for each entity or DB result a class in a class library folder
e.g. entity... Create a class .e.g Address in this folder and define
all the fields as properties
So when db returns Table I move the records in to my generic class.

e.g. table Address returns name, address, city, country.... Then I
create an class in a folder (entity) and define the 4 properties
( name, address, city, country)
so my class is a mirror of my table (returned fields)

when I read records from table I move all records in into this
instantiated List<Address> or Address object and return from my
factory method this way.

3 main reason:
- type safe (no troubles with int, string etc) and
- it promptes at the intellisence,
- I return objects and not tables or dataset so I'm independend to
any language platform... e.g. Java, php can knows objects so ILIST is
is good to move iso of linked to ADO.

But I get discussion with some people to not returning generic
ILISt... they think it's unnessary... They strongly encourage me to
use Typed Datasets. They also tell that there is
intellisence rpompted etc...

Well I havent't much experience with Typed Datasets... And as I told
it's too depended to ADO.NET. No outside programming languages knows
this...

What is your feeling? What would you use "Return Typed dataset" or
"Return Generics (class)" like List<Address> or Address

If you google it then you will find plenty of discussions about the
topic.

I am mostly on the List<X> team.

It is a general structure that are not tied to data layer in the same
was as a typed data set.

And it fits better with ORM and the .NET 3.5 features.

So I consider it better at least for larger projects.

Arne
 
S

sloan

PS

I am a custom object, custom collection person 99% of the time.

The main time I deviate (to strong datasets) is for reports.
Creating an object object for a report seems like overkill.


The cost of software is not development, but rather maintenance.
Custom objects (the extra cost up front) will save you time later.

And finding a match from a custom collection is alot easier than writing

ds.MyTable.Select("WHERE_CLAUSE") statements............this is a headache.


Download my 2.0 example here:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!140.entry


Keep in mind I wrote that ~before I adopted the:

public class AddressCollection : List<Address>
{
//yep, that's it
}

practice.
 

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

Top