Wednesday, September 24, 2003

The 2-pin theory.

Sean McGrath wrote a thought provoking piece.

I caught myself responding on one of the news groups & thought I'd share...

Wow - nice piece from Sean. Thought provoking.

Is the *magic* of the interface related to the *2-pin* theory (i.e., do(x)) or it related to advancements in protocol negotiation? Does USB work better because of the number of pins or because of the structured negotiation between participating components? What about BlueTooth?

WS-* is moving into a world where dynamic protocol negotiation for non-functional requirements will be able to happen on the fly.

An example of two web services talking to each other (think consumer:producer) :
Service 1: Can you do encrypted?
Service 2: Yes, I do TripleDES, Do you?
Service 1: Yes, let's do it!
Service 1: Do you do Reliable Messaging?
Service 2: No, not for this operation.
Service 1: Can you treat this operatin as part of a transaction?
Service 2: No, I can't, but I do have a compensating mechanism, see URI:xxx.wsdl
Service 1. Great, I'm going to use it.

Now, an interesting question is how did databases servers get away with a small number of interfaces / operations? The answer is that they created languages which could be shipped across a wire to perform more complex functionality. Thus, the database has the notion of the do(x) - or if you'd like, you could say that it had:
do(ANSI SQL 92)
do(stored procedure), etc.

Back to the conversation:
Service 1: Now, it is time for us to do some real work, I need some data, do you support XQuery 2.0?
Service 2: Of course! Send your query on over!
Service 1: Ok, here it is: (query blah, blah, blah)
Service 2: Great! Here is your result (some data, ....)

Now, of course, you wouldn't want the conversation to be anywhere near this verbose... but you get the idea. Simplicity in interface doesn't just happen by creating a magic "do(x)" - you have to actually have some meat behind the operation. Web service protocol designers are attacking both of these fronts (NFR protocol negotiation and ubiquitous, shippable languages like XQuery).

IMHO, looking for simplified interfaces is good - just be careful not to throw away your meta-data just to make a clean WSDL.

No comments: