Dataset to Custom Collection converter?

S

Simon Woods

Hi

Does anyone know if there any dotnet software out there which converts a
dataset into a collection of custom objects, programmatically i.e.
actually creates the class structure and collection class on-the-fly
based on the fields in the dataset and then creates and populates the
classes and adds them into the collection.

Thanks

Simon
 
C

Cor Ligthert [MVP]

Simon,

A non strongly typed dataset itself is a Class, that exist from collections
of DataTables and Relations, however indexed by field names, indexes and in
the case of rowitems datacolumns.

When you use an XSD you can automaticly create a strongly typed dataset,
which makes it possible direct to address the properties of the items.
Therefore can you give us some more informoation what you mean with a
collection of custom objects.?

Cor
 
S

Simon Woods

Cor said:
Simon,

A non strongly typed dataset itself is a Class, that exist from collections
of DataTables and Relations, however indexed by field names, indexes and in
the case of rowitems datacolumns.

When you use an XSD you can automaticly create a strongly typed dataset,
which makes it possible direct to address the properties of the items.
Therefore can you give us some more informoation what you mean with a
collection of custom objects.?

Cor

Thanks Cor

A bit more background ... it's fundamentally an architecture issue which
I don't think I've got my head round (that may be an understatement!).
There seem to be a fair amount of debate about whether to opt for custom
collections or datasets, when passing data across n-tiered apps. It
seems that a common (preferred?) practice, for enterprise-type apps at
least, is to convert the dataset via data transfer objects into business
objects. This is fine, istm, when the business object can be predefined.

However, the app I'm working on is a querying app. So the user can
specify and retrieve whatever they want. A dataset is the obvious way to
transfer data from the back-end to the UI, wrapped up in a business
object and then, for example, being a binding source or whatever. I was
wondering about the possibility of constructing classes (and their
collections) on-the-fly[1] and using the collection as a binding source
- the SQLs SELECT clause effectively providing the template to the class
structure.

It strikes me that the typed-dataset is still fundamentally oriented
toward the underlying RDMBS structures rather than the business. Further
because all the processing is being done behind the scenes, I can't see
that the typing aspect of the dataset really offers any benefit in this
scenario (unless there's someway to transpose the dataset structure into
a class structure). The other thing is that I'm using a third party
framework which effectively encapsulates the network, but to do this my
business objects need to inherit certain classes from that framework.
The only way I could see this being facilitated is by having a
predefined business object which both inherits the framework class, and
also holds a property to which the dataset can be assigned.

But perhaps I'm way off beam! Interested in any advice or thoughts though.

Simon

1. I was experimenting with the CodeDom - there's an earlier post on
this ng - to see if it was possible, but the more I've played around
with it, the less convinced I was that it is a good way to go. I wonder
whether dotnet would need to be more dynamic i.e. Ruby-like - or perhaps
there are other aspects of dotnet I'm unware of which would make this
easy for me?
 
G

Guest

Simon,

do you ***have*** to use DataSets?

if not have a look at LLBLGen(www.llblgen.com)

cheers

Guy
Cor said:
Simon,

A non strongly typed dataset itself is a Class, that exist from collections
of DataTables and Relations, however indexed by field names, indexes and in
the case of rowitems datacolumns.

When you use an XSD you can automaticly create a strongly typed dataset,
which makes it possible direct to address the properties of the items.
Therefore can you give us some more informoation what you mean with a
collection of custom objects.?

Cor

Thanks Cor

A bit more background ... it's fundamentally an architecture issue which
I don't think I've got my head round (that may be an understatement!).
There seem to be a fair amount of debate about whether to opt for custom
collections or datasets, when passing data across n-tiered apps. It
seems that a common (preferred?) practice, for enterprise-type apps at
least, is to convert the dataset via data transfer objects into business
objects. This is fine, istm, when the business object can be predefined.

However, the app I'm working on is a querying app. So the user can
specify and retrieve whatever they want. A dataset is the obvious way to
transfer data from the back-end to the UI, wrapped up in a business
object and then, for example, being a binding source or whatever. I was
wondering about the possibility of constructing classes (and their
collections) on-the-fly[1] and using the collection as a binding source
- the SQLs SELECT clause effectively providing the template to the class
structure.

It strikes me that the typed-dataset is still fundamentally oriented
toward the underlying RDMBS structures rather than the business. Further
because all the processing is being done behind the scenes, I can't see
that the typing aspect of the dataset really offers any benefit in this
scenario (unless there's someway to transpose the dataset structure into
a class structure). The other thing is that I'm using a third party
framework which effectively encapsulates the network, but to do this my
business objects need to inherit certain classes from that framework.
The only way I could see this being facilitated is by having a
predefined business object which both inherits the framework class, and
also holds a property to which the dataset can be assigned.

But perhaps I'm way off beam! Interested in any advice or thoughts though.

Simon

1. I was experimenting with the CodeDom - there's an earlier post on
this ng - to see if it was possible, but the more I've played around
with it, the less convinced I was that it is a good way to go. I wonder
whether dotnet would need to be more dynamic i.e. Ruby-like - or perhaps
there are other aspects of dotnet I'm unware of which would make this
easy for me?
 
S

Simon Woods

Thanks Guy ... I'll have a look.
Simon,

do you ***have*** to use DataSets?

if not have a look at LLBLGen(www.llblgen.com)

cheers

Guy
Cor said:
Simon,

A non strongly typed dataset itself is a Class, that exist from collections
of DataTables and Relations, however indexed by field names, indexes and in
the case of rowitems datacolumns.

When you use an XSD you can automaticly create a strongly typed dataset,
which makes it possible direct to address the properties of the items.
Therefore can you give us some more informoation what you mean with a
collection of custom objects.?

Cor
Thanks Cor

A bit more background ... it's fundamentally an architecture issue which
I don't think I've got my head round (that may be an understatement!).
There seem to be a fair amount of debate about whether to opt for custom
collections or datasets, when passing data across n-tiered apps. It
seems that a common (preferred?) practice, for enterprise-type apps at
least, is to convert the dataset via data transfer objects into business
objects. This is fine, istm, when the business object can be predefined.

However, the app I'm working on is a querying app. So the user can
specify and retrieve whatever they want. A dataset is the obvious way to
transfer data from the back-end to the UI, wrapped up in a business
object and then, for example, being a binding source or whatever. I was
wondering about the possibility of constructing classes (and their
collections) on-the-fly[1] and using the collection as a binding source
- the SQLs SELECT clause effectively providing the template to the class
structure.

It strikes me that the typed-dataset is still fundamentally oriented
toward the underlying RDMBS structures rather than the business. Further
because all the processing is being done behind the scenes, I can't see
that the typing aspect of the dataset really offers any benefit in this
scenario (unless there's someway to transpose the dataset structure into
a class structure). The other thing is that I'm using a third party
framework which effectively encapsulates the network, but to do this my
business objects need to inherit certain classes from that framework.
The only way I could see this being facilitated is by having a
predefined business object which both inherits the framework class, and
also holds a property to which the dataset can be assigned.

But perhaps I'm way off beam! Interested in any advice or thoughts though.

Simon

1. I was experimenting with the CodeDom - there's an earlier post on
this ng - to see if it was possible, but the more I've played around
with it, the less convinced I was that it is a good way to go. I wonder
whether dotnet would need to be more dynamic i.e. Ruby-like - or perhaps
there are other aspects of dotnet I'm unware of which would make this
easy for me?
 
C

Cor Ligthert[MVP]

Simon,

As you can see using LLBGen there are more solutions. However be aware that
the reflection of a dataset to a database is not a matter of how it has to
do with the business. It is the true limitation of a SQL based database
servers. You cannot make complex types in that. It exist from related tables
with fields and that it is, whatever magical they write about it.

The advance from ADONET and the Dataset is, is that it is probably the
maximum reaching the off line handling of that. (If you have complex
datatypes in an XML file it makes from it by instance more tables in a
Dataset).

Be aware that there is in my idea a very big retro group who is still
talking about Multi Tier application. However, that are not real multi tier
applications as they were ever designed in past. It are just datalayers
however it sounds nice to call them Tiers. Tiers work in my opinion
assynchroon as they did in MultiUser computers. However in a nice client
server concept as the Windows OS systems is there in most normal situations
not any need for that.

(Before you understand me wrong, I like multilayer solutions, however that
is not a goal for me. The goal is a good working and maintanable solution).

About your wish to make data and type independent classes, you are really
not the first who is wanting to create an MS Office Access solution, however
better, and then be disapointed that in the end the users will ask you why
it is not like MS Access. The change that your solution ends in spaghetti is
difficult to prevent.

As last and not only to prevent that Frans get angry on me. I have seen in
this dotNet newsgroups only very positive reactions about the use of LLBGEN.
So despite my message for sure worth to investigate.

Just my opinion.

Cor
 

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