Does doc/literal guarantee loose coupling?

Eric Newcomer writes about the use of doc/literal when building WS applications. He supports the idea of document exchange to achieve platform integration. Of course, I agree with Eric since this is exactly what Jim and I have been advocating for some time.

I would like to comment on this particular comment by Eric...

The doc/literal style would seem to be the most abstract or the most "loosely coupled," since it does not include data typing (although data typing is provided by an associated XML Schema) and does not include a method name in the message.

Indeed, the use of doc/literal style may seem to offer loose coupling. As Don Box says (MSDN show part 1, part 2), we share schema and contracts and not classes. However, doc/literal and Web Services do not guarantee loose coupling. One could still come up with protocols and patterns that go against everything that Eric suggested (yes, as you'd expect, WS-RF comes in my mind 🙂

One response to “Does doc/literal guarantee loose coupling?”

  1. Yes, agreed. Doc/lit is basically just a syntactic statement – the envelope will contain a document rather than a request for something explicit to happen – not an architectural one, where any particular architectural constraints are implied. You can end up doing the architectural equivalent of a “request for something explicit to happen” using doc/lit (which seems to be the current “SOA” method-du-jour), as well as the more loosely coupled, state transfer, uniform interpretation of HTTP POST, SMTP DATA, or “processMessage”.