I'm not going to assert that I've fully thought this through, but couldn't your "shared assembly" define an appropriate object class that has a constructor that accepts XML? (It might also have a SetState method that resets the state completely from XML, so you don't have to build a new object in order to change the XML data it represents.)
In other words, provide the "internal object model" in a shared assembly so that each developer doesn't have to do the same work to consume the agreed-upon XML. Of course, objects of this class should be able to generate appropriate output XML. If anyone decides to do so (e.g. they're taking a fling writing some part of the app in Java, or they don't like your object model) they can read and write XML however they choose. If you enhance the system so that there are new (presumably optional) values represented in the XML, you can provide a new shared assembly that defines an enhanced class that inherits from the original. The developers who don't want or need to use the new functionality don't have to update any code, and don't need the new assembly. Those who need the new stuff can pick up the new assembly, and the only code they'll need to change is the declared datatypes; of course they'll need to add code to work with the new info. In some places they won't even need to change datatypes -- any routine that doesn't care about the new info can work with objects of type OriginalObjectClass; only if there's a need to read or update the (e.g.) new property does the signature need to change to mention EnhancedObjectClass, because any EnhancedObjectClass object "is an" OriginalObjectClass. That seems to give you the best of all worlds -- you get the flexibility of XML, no need to update everything at the same time, and the programmer-friendliness of providing code that hides the XML grunge from your co-workers. At 09:27 PM 2/11/2004, Andrew Hopper wrote: (in part) >(Copied in part from my blog at http://www.dotnetified.com) >[snip] >Enter XML Web Services. Instead of using shared datatypes libraries, we just >agree on a contract and pass XML back and forth. Now we have this wonderful >loosely coupled mechanism so that old apps continue working without a >recompile! Oh, but now every client app developer has to write an internal >object model unless they are willing to dispense with strong typing and >don't mind littering their app with XPath statements. >[snip] >All of the above being said, I am currently gravitating towards the shared >assembly and RPC model. Why? Because I work with a group of developers, all >of whom are writing the client side apps while I toil away on the >server-side. I could simply ask them to consume XML and not worry my pretty >head over how they manipulate the data, but it's MUCH easier for them to >reference my shared types assembly, add a Web Reference, then run my >"Munging Macro" to fix up the types used by the proxies. Happy colleagues >means happy Andy, because I then don't get angry/confused phone calls. Yes, >the SOA idea is a good one, but I believe it only works well if A) you are >only trying to provide a service (i.e.: clients ain't your job) and B) only >one client for the service is being written by the developer. > >-Andy Hopper J. Merrill / Analytical Software Corp =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
