Typed Datasets and .NET Remoting
I didn't really like the DataSets too much. I felt they did too much. After having a discussion on strongly typed datasets with Roy Osherove a couple of weeks ago I decided to put my DataAccess framework with ValueObjects, DataAccessObjects and ServiceFactory/Locators on the shelf for a little while and give strongly typed datasets a real go.
I have to admit that this feels pretty good. I'm starting to get the same experience as Jeff did back in february (only I'm slow:)
I like the notion of creating the XSD as the "first-point-of-action". XSD is not dependant on the datasource and could possibly be generated to any kind of transport, dataset as well as custom business entities (and collections of these).
So what maybe would be a good idea is if XSD's could be reversed into database schema (and sp's) just as you can create XSD from SQL Server objects via the Server Explorer in VS.NET.
The remaining question for me now is how to handle typed datasets with .NET Remoting. There seem to be some options:
1. Share the xsd between Server and client. Generate the typed data set classes separately. Let the server write the typed dataset to string (WriteXml) before shipping it off to the client. The client uses ReadXml on the typed dataset. This way the only dependency between the server and client is the xsd.
2. Something new in some new version? I read this post where it is stated that typed datasets will be supported over remoting. But how?
3. Use a tool like XGoF to generate an Interface based on the server typed dataset and distribute this interface to the client. There might be issues related to custom DataTable classes generated within the typed dataset class not beeing marked as [Serializable]. Also you'll probably have to add the MarshalByRefObject attribute manually.
I didn't get to try out this last option because I didn't bother fiddeling with the opensource project so it would build. But the idea seems pretty good if you are distributing remoting interfaces to the client anyways.
I saw that Ingo Rammer discusses this topic in his training session, but I sure can't afford flying in Ingo to figure this one out:)