Beware of reusing Class Library between Web Service and consumer

About a month ago I wrote about the ability to reuse a class library of data structures between Web Service and consumer. I've been thinking about this, and discussed this with colleges and my current customer's software architect.

The main reason is because we have to be careful when to reuse a Class Library. First of all, don't just share the data-structures between services belonging to different business processes. Why? Because this could help you forget about who's the owner of the data, and responsible for the data structure. And second, why should we reuse? Because we would help ourselves, by using Generic Lists vs standard Arrays. Or because we could use some local methods on a data structure?

We will have to deal with those very small problems, why take risks about bringing ourselves into big trouble for this. Web Services can be used with proxies, although some people advocate you should actually use xml-documents instead of serialized classes with Web Services. I think a book like "SOA Patterns" could help us in the future so we won't have to make almost mistakes.

Small note: There is a bug in the SchemaImporterExtension, which causes the extension not to be called for base classes. More about this here.

Gravatar