How do you stop the leak?

Service Station, by Aaron Skonnard

Syndication

Check out Craig's view on the contract debate. Despite what you may think, I agree with most of what he says and do believe that developers using either approach can be successful if they have sufficient understanding. Building software is full of tradeoffs and compromises, pros and cons, and in the end you have to get the job done. Period. Whatever approach helps you accomplish that is the right one.
 
In fact, whenever I teach courses on Web services I start with a discussion on "leaky abstractions" and point students to Spolky's piece (it even made it into the official slides). I found over the years that you really had to motivate developers to learn about the mappings, otherwise they're happy to ignore it.
 
My opinion on this whole issue is based on these types of interactions with numerous WS developers and orgs in recent years. In my experience, those who don't hide behind an object model are typically more prepared to deal with leaky abstractions and, more importantly, stop them when they occur. Developers who invest in learning about XSD/WSDL (even if they don't code to it directly) are more likely to understand the myriad of mappings Craig describes than those who don't. That's the reality I see.
 
In fact, for most developers the whole motivation for going the code-first route is to avoid having to learn that "tedious" stuff altogether. I have no problem with developers who clearly understand XSD/WSDL, along with the corresponding System.Web.Services attributes, but choose to adopt a code first process for productivity sake throughout an org (along with prescribed best practices of course). This is simply not common from what I've seen. Instead they do it because ignorance is bliss.
 
Regardless of which approach you choose, when you have to fix a leak, you'll be forced to deal with what's on the wire. Obviously this is more approachable for developers who are familiar with XSD/WSDL and who started by designing things in those terms. If nothing else, adopting a contract-driven process within an organization encourages filling this crucial knowledge gap. 
 
Unfortunately, this discussion has can't seem to move away from generalizations, which makes it difficult for casual spectators to measure the pros and cons of the different models given their particular problems. I firmly believe that there are specific situations where a contract-driven approach is the only practical way to design and successfully build SO systems. But I think that horse is officially dead.
 

Posted Apr 27 2005, 05:44 PM by Aaron Skonnard
Filed under:

Comments

Sean Chase wrote re: How do you stop the leak?
on 04-27-2005 2:01 PM
What if you go the route creating an XSD schema (as you would in BizTalk) and then create DTO classes based on the schema. Is that "contract-first enough" or is there still quite a ways to go from there? I'm coming at this from a Visual Studio .NET developer's perspective where the tools are not geared towards contract-first. Just curious what your thoughts are.
Aaron Skonnard wrote re: How do you stop the leak?
on 04-27-2005 2:15 PM
Absolutely. I commonly propose this as a nice sweet spot given today's tool support. In the second part of my contract-first series(MSDN Mag) I walk through the step-by-steps for accomplishing this with ASMX in what I call the "Hybrid Approach". It let's you avoid authoring WSDL directly but still allows you to focus on XSD message design. The trick is to make all WebMethods doc/lit/bare.
Sean Chase wrote re: How do you stop the leak?
on 04-27-2005 9:00 PM
Nice! Can't wait to read it. Regarding the schema-first approach, it's good to know that's at least a step in the right direction. :-)
Jon Flanders wrote re: How do you stop the leak?
on 04-28-2005 4:30 PM
Sorry for the late post - but even in BizTalk (our favorite product ;-) contract first has limitations - see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdk/htm/ebiz_prog_webservices_wqvg.asp Where you can't consume webservices that use single or multi-dimensional arrays. So I think that limitation supports the argument that even if you do contract first, you have to know the limitations of the product/toolkit you are using or you are dead. So you either know the limitations of the autocode generation of your toolkit or you know the limitations in terms of wireformat. In actually I think you and I believe that you always have to know the limitations of the wireformat anyway.
TheChaseMan's Frenetic SoapBox wrote XSDs, Xsd.exe, Web Services, and contract-first Service Development
on 05-02-2005 6:02 PM

Add a Comment

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