Thursday 23 July 2009

End the SOAP: this is how simple it should be

After yesterday's scorn on the everlasting SOAP, another explanation about enveloping and routing is probably in place

In the ideal world, all service requests and responses are sent in an envelope, like in the old-fashioned mail. In the old-fashioned mail, however, we already see standards on a national level conflicting with those of another country, so even there is no uniform envelope-definition. But, as we've seen, they all have the same in common: a recipient, a sender, and a unique address in 4 stages: country; zip; street and number. In fact, the country indicates how the address is exactly made up, functioning as a "case statement" in IT

Well the design is complete. Now the big problem has to be tackled: what if your envelope isn't equal to my envelope? Yet again, that problem has been tackled

If you order a book at Amazon, they look it up. They put it in a brown carton, and put a barcode on top - Amazon's own envelope. At the doorstep of Amazon, e.g. UPS picks it up. They put the brown carton inside a plastic bag, and stick a barcode on it that is also humanly legible - UPS's own envelope. Across borders, national couriers take over. They probably just turn the plastic bag around and slap another barcode sticker on it - their own envelope.
So, history repeats itself: each envelope is wrapped in another one. What does the final recipient do? As he is the only one interested in the package content itself, he unwraps all envelopes. As he has no need for them in the future, he throws them away

Been there done that, haven't we? Let's compare that to our favourite mailman

You have a letter, which you put in an envelope. The envelope has the necessary -mandatory!!!- data or else it can't be delivered (just having another go at SOAP here, sorry).
The envelope makes it to the mailbox. When the mailman makes it to the mailbox, he takes out his own envelope and wraps that around all other envelopes. Yes, that envelope is a mailbag. He tags it so he knows who the sender was (this very mailbox) and continues to the post office.
There, he unwraps the envelope / empties the mailbag. The content gets sorted, and makes it into other envelopes.
Those envelopes make it to distribution centres, are once more emptied, and sorted again.
The mailman delivers the envelopes to their addresses, et voila, done deal

So, another mystery solved:

1. All attributes on an envelope are mandatory, well-defined and highly standardised
2. If it's not your envelope, just wrap your own around it
3. If you want to read the content, you'll have to unwrap all other envelopes

Three simple rules for a global messaging system. More on this later

0 reacties:

Post a Comment

Thank you for sharing your thoughts! Copy your comment before signing in...