« Detailed EPR metadata proposal | Main | Impedance mismatch »

Focus on the contract

Tim offers some extremely excellent advice (as usual) regarding what really matters when you write your services. If I may paraphrase what he says and perhaps embellish it a bit, starting from the implementation language and generating your contracts from it is just plain wrong, wrong, wrong, at least for systems of any appreciable magnitude, reach, or longevity. Instead, focusing on the contracts first is the way to go. I've written about this for many years now, starting well over a decade ago.

When you start with the code rather than the contract, you are almost certainly going to slip up and allow style or notions or idioms particular to that programming language into your service contract. You might not notice it, or you might notice it but not care. However, the guy on the other side trying to consume your service from a different implementation language for which your style or notions or idioms don't work so well will care.

Last summer a customer told me that he had read and heard my advice about starting with contracts, not code, but that he didn't understand it at all until others from elsewhere in his large corporation started trying to use his contracts to write new services or new service consumers. It wasn't until then, he said, that he was able to see how many idioms and assumptions and implementation details had crept into his contracts. His new approach is to still generate his WSDL contracts from code or IDL, but to then take the generated WSDL and go over it in detail to try to remove all those unwanted assumptions and implementation details. He says this approach results in simpler, cleaner, and much better abstracted service contracts. That result doesn't surprise me at all.

Also, I'd like to add a third piece of advice to Tim's list:

3. "SOA" does not stand for "Special Object Annotations."

Which is better: implementation code polluted with a bunch of weird square bracket annotations that inextricably (and also inexplicably) hard-wire your code to what goes on the wire, or nice, clean service contracts that keep implementation details separate? I prefer the angle brackets to the square ones, thanks.

TrackBack

Listed below are links to weblogs that reference Focus on the contract:

» A Day of Indigo from Dave Bettin on Services
[Read More]

» A Day of Indigo from Dave Bettin on Services
[Read More]

» Interop is Hard from Sam Ruby
I agree with Simon, Steve, Tim, and Gia. Don't program inside out If you find that you must use a toolkit to help with generating the contract, I'd recommend a technique that is similar to Steve's customer's: generate WSDL using a foreign toolkit, [Read More]

» Contracts define agreement from Service Station, by Aaron Skonnard
[Read More]

» Contracts define agreement from Service Station, by Aaron Skonnard
[Read More]

» Contracts define agreement from Service Station, by Aaron Skonnard
[Read More]

» Contracts define agreement from Service Station, by Aaron Skonnard
[Read More]

» Contracts define agreement from Service Station, by Aaron Skonnard
[Read More]

» Contracts define agreement from Service Station, by Aaron Skonnard
[Read More]

» Contracts define agreement from Service Station, by Aaron Skonnard
[Read More]

» Vinoski is Right (Contract First) from Business Implications of Web Services
[Read More]

Comments (1)

MS:

But the point is, if the tools are "tight" and produce 100%-pure/standardized/agreed-upon contract, should the developer still need to go and tinker with it?

Angle brackets are for consumption by tools and not humans.

About

This page contains a single entry from the blog posted on February 10, 2005 12:20 AM.

The previous post in this blog was Detailed EPR metadata proposal.

The next post in this blog is Impedance mismatch.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.31