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 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.