This post originated from an RSS feed registered with .NET Buzz
by Scott Hanselman.
Original Post: Checking post-conditions in SOA as (or more) important than checking pre-conditions
Feed Title: Scott Hanselman's ComputerZen.com
Feed URL: http://radio-weblogs.com/0106747/rss.xml
Feed Description: Scott Hanselman's ComputerZen.com is a .NET/WebServices/XML Weblog. I offer details of obscurities (internals of ASP.NET, WebServices, XML, etc) and best practices from real world scenarios.
I agree with Clemens
on the postcondition discussion. At the risk of using two quickie "gun/bullet"
analogies in a month, I offer this one to explain why checking post-conditions is
as (or more) important as checking pre-conditions.
It's better to take the bullets out of the gun, than to wear a bullet-proof vest.
Too often message validation is considered a defensive manuever to protect one's
self from bad input. I believe this "knee-jerk" style of coding is an artifact
of C and C++ where engineers always check input pointers for nulls and such.
In a system that is constrained by contracts, you certainly know as much about the
outgoing messages and inherent contract as the incoming, so there's no reason not
validate the outbound messages.