Will the real "service contract" please stand up?

Service Station, by Aaron Skonnard

Syndication

Tim and Clemens have been going back and forth over the importance of XSD/WSDL/Policy and its role in SO systems. This debate was spawned by Clemens posting some Indigo code containing a [ServiceContract] definition and arguing that you should "break the bad habit of angle brackets." Here's a recap:
 
Clemens: [Indigo code] is a perfectly reasonable way to share contract between server and client… Staring at WSDL is about as interesting as looking at the output of "midl /Oicf".
 
Tim: XML is not just an implementation detail, it is the implementation detail that actually makes this Web services thing work… Remember that WSDL/XSD/Policy is the contract, period. Any other view of your contract is just an illusion.
 
Clemens: WSDL and XSD and Policy are interoperable metadata exchange formats. That’s just about it... But WSDL/XSD/Policy isn’t the contract.
 
Tim: I think that writing some code in your tool and having it generate the logical part of your contract is a bad idea if you don't know and care about exactly how it works.
 
Clemens believes that it's perfectly reasonable to express a service contract in a C# interface definition a la Indigo, while letting the runtime produce the XSD/WDSL/Policy definitions as an byproduct, and as a result, you should never have to look at angle brackets again. Tim, on the other hand, believes that the official service contract is the collective XSD/WSDL/Policy definition and therefore special attention must be paid to what they say.
 
If you live in the real world, Tim is right, and Clemens is clearly wrong.
 
You only have to reach for your nearest Webster's to learn the meaning of the word "contract":
 
1 a : a binding agreement between two or more persons or parties;
 
Obviously an agreement between two parties implies that both sides understand what's being said. A contract communicates the rules we agree to play by in a language we understand. I would never sign a business contract authored in German since I'd have no clue what I'd be agreeing to. Likewise, there's no way a Java client is going to have anything to do with a contract authored in Indigo C# definitions. You can translate the Indigo C# definition into an XSD/WSDL/Policy definition, which the Java client would be abel to understand. That clearly makes the XSD/WSDL/Policy the official contract.
 
If your entire SO system is only using Indigo, you can get away with sharing C# contract definitions with consumers since both sides understand them, and the XSD/WSDL/Policy translations should never get in your way since it's the same runtime on both sides. From his posts, it seems that this is the only world Clemens knows. Realistic SO systems are a built from a melting pot of languages, frameworks, and platforms. In that reality, the only contract definition language that all parties understand is XSD/WSDL/Policy. And history has proven that runtime translations between the native programming language and XSD/WSDL/Policy can easily get in the way and hurt interoperability if you don't understand what's going on.
 
You can obviously choose to ignore this fact, but that does not change the reality that the XSD/WSDL/Policy is the official contract - it must be since it's what defines the agreement between parties. If I want to consume a service offered by Acme, Acme presents me with their service contract (the XSD/WSDL/Policy definition) and I'm obligated to conform to it if I want to use the service. I have no idea what the contract looks like in Acme's implementation environment (a la Indigo), but I know what the implementation is supposed to do, and what I'm required to do, according to the contract definition (XSD/WSDL/Policy).
 
What was the contract definition language in COM? It was clearly IDL, not VB or C++ class definitions, because IDL was the contract language all parties understood. If you believe that IDL defined the contract in COM, I don't see how you could argue that XSD/WSDL/Policy doesn't play the same role in WS. Nevertheless, multitudes of VB developers ignored IDL and just wrote class definitions, and as long as they were connecting with other VB components everything was cool. However, once they tried to hook up with a C++ component, careful analysis and modifications to the IDL contract were almost always necessary.
 
Ignoring this reality will inevitably impact your reach as Tim stated, as you're bound to generate service contracts (XSD/WSDL/Policy) via your framework that are difficult for others to consume. What's most discouraging is that a large class of developers are likely to share Clemen's perspective and do what's easiest now. I believe that if we had better tools we could steer the ship in a different direction. Tools like WSCF are a good start, but vendors like Microsoft must commit to a true contract-first development environment that shields some of the angle-bracket-pain while helping you focus on the true service contract.
 
 
This whole discussion is very related to my upcoming two-part series (which I mentioned here) on contract-first development. It should hit my MSDN Magazine column (Service Station) in a few months. Stay tuned.

Posted Feb 10 2005, 12:00 PM by Aaron Skonnard

Comments

Christian Weyer wrote re: Will the real "service contract" please stand up?
on 02-10-2005 9:35 AM
http://weblogs.asp.net/cweyer/archive/2005/02/09/370374.aspx
Lorenzo Barbieri @ UGIblogs! wrote Non sono l'unico a storcere il naso...
on 02-10-2005 11:03 AM
Dilip wrote re: Will the real "service contract" please stand up?
on 02-10-2005 12:03 PM

Naturally there is a overwhelming support for the CF approach. See Steve Vinoski's post:
http://www.iona.com/blogs/vinoski/archives/000141.html
Eric Giles wrote re: Will the real "service contract" please stand up?
on 02-10-2005 5:06 PM
I believe that we need to maintain a clear view of a purely abstracted defintion language for service interfaces.

We should be looking to interface services to any and all implementation points and as we have learned from the past, automated tools and single vendors providing their own implementation does not deliver the sort of openness that we need to maintain here.

I would much prefer to see tools built completely around the interface, defining policy, contract, validation etc. and then, once done, look at how to write solutions to conform with the interfaces' requirements.

As far as I'm concerned, if it involves the definition of service interfaces and it isn't from a unique, global body without a vested interest in any one implementation platform, I will give it more of my time and interest.

Let them just create great tools to work with these open interfaces.
William Tay wrote re: Will the real "service contract" please stand up?
on 02-10-2005 6:45 PM
http://www.softwaremaker.net/blog/PermaLink,guid,cd3c52b8-7f7a-466e-a68c-149401598e13.aspx
Marc Hoeppner wrote re: Will the real "service contract" please stand up?
on 02-10-2005 11:30 PM
Aaron, I have to say that I agree with Clemens 100%. I would say that if you really live in the real world, you definitely need a lawyer for your contracts, because these things get too complicated to understand. You only need to understand the contract to a certain degree and trust your lawyer to spec out the details as you have no realistic way of knowing if the contract is tight or not (since you are no lawyer in the first place, that is why you hired one...). The framework should act as my lawyer when I work on contracts with external parties and hide the intricacies as much as possible.
Back in Blog wrote Do you want to write yourself XSD/WSDL/Policy contracts?
on 02-11-2005 12:38 AM
Brain.Save() wrote Isomorphism
on 02-11-2005 1:35 AM
Brain.Save() wrote Isomorphism
on 02-11-2005 1:40 AM
Don Box wrote re: Will the real "service contract" please stand up?
on 02-12-2005 3:32 PM
I hate to throw gasoline on the fire, but here's my 2 cents.

1. For now, we exchange human readable documentation. Period. All else is secondary albeit important and nice.

2. WSDL/1.1 + XSD/1.0 are currently the dominant interop formats for augmenting #1. They're strictly optional as the POX folks will tell you.

3. Statistically no one authors #2. Rather, they use some local DSL (e.g., XML Spy's visual notation, annotated interfaces, IDLs, box & arrow tools, etc.) to author and then use #2 for interchange.

4. DSLs that have non-deterministic mappings to #2 are evil and should be ditched.

5. Local use of DSLs that have deterministic mappings to #2 are opaque provided you're always willing to cough up #2.

If you really believe that #2 is important, then why do you care if some people use #5?

DB


Service Station, by Aaron Skonnard wrote Contracts define agreement
on 02-16-2005 6:39 PM
JCooney.NET wrote What defines a Service Contract
on 02-17-2005 8:40 AM
JCooney.NET wrote What defines a Service Contract
on 02-17-2005 8:42 AM
JP Morgenthal wrote re: Will the real "service contract" please stand up?
on 02-18-2005 2:20 PM
If I understand Don's attack of TLA's, then I agree with his point. The whole reason RPCs were developed was so that the programmer did not have to leave his/her paradigm in order to call functionality running in some other address space. The contract is critical to making sure the plumbing all connects up once the programmer makes the call from their own progammatic perspective, but I hope that we do not asking programmers to adopt a special programming paradigm for Web Services and another for developing the programs that use those services.
SOAphisticated wrote Gurus in the street
on 02-18-2005 2:42 PM
Semantic Pal wrote Grow up Clemens!
on 02-23-2005 11:40 PM
Clemens, just open up your brain and absorb Tim's comments. You'll feel better in the end.

The main difference between service and object orientation is that services are business-oriented while objects are technology-oriented. That's about it. The rest is a deduction from this statement.

Let an 'architecture' team create the building blocks (services) plus the glue between them and let the developers implement the building blocks.

Closing remark: don't be afraid of the new, don't be afraid to leave the known behind.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?