Sunday, February 26, 2006

Contracts: Easy in Java, hard in WebServices

With RC1 of Obligate its worth quickly explaining why something that was done in pretty short time in Java is proving really hard to do in Web Services.

There are as I see it three main problems
  1. WebServices are an interface specification only, contracts are often about logic
  2. There are lots of choices about how to do it, none of which do everything
  3. Many of the specification people don't work on end-user problems

The first is a major challenge. When we wanted to do obligate we just downloaded GroovyRules and used JSR 94, a little bit of Java SE 5 annotations and it was done.

With Web Services its much more complex, you could apply an XSLT to do increased data restrictions, use WSDL-S (Semantics) and OWL files to do some of the richer comparisons between data like comparing fields and the like. And then you could tie in BPEL to do the functional preconditions that need to be done. Its not quite so easy really is it? And to me this is part of the challenge raised by point 3. When people are using Web Services and talking about governance they want to do the sort of simple business things like "not between 2am and 5am" or "Must have valid PO" which require a call to another functional service or system facility.

What we need is a simple way to define these things, via tools, where the massive complexity on what needs to be done is nicely hidden from business. It also needs to be applied in a consistent manner, such as WS-Policy, and definitely not in the WSDL file itself.

No comments: