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?