Compatibility and Evolution in an Asynchronous World
|
|
In a modular system, modules are supposed to be substituable. It's one of the six operators that should be available in a modular system. In object oriented programming, this operator is goverened by Liskov's Substitution Principle. That is, methods that use base classes must be able to use derived classes without knowing about it.
Liskov's Substitition Principle is further enforce by Meyer's Design by Contract. Which states:
- An overriding method may [only] weaken the precondition. This means that the overriding precondition should be logically "or-ed" with the overridden precondition.
- An overriding method may [only] strengthen the postcondition. This means that the overriding postcondition should be logically "and-ed" with the overridden postcondition.
- A derived class invariant should be logically "and-ed" with its base class invariant.
In the world of protocol design, these pre and post conditions are summarized by Postel's design guideline "Be liberal in what you accept, and conservative in what you send".
What I can't get a handle on is that these principles and guidelines seem to be have an assumption of a client and server relationship. This is a consequence of its synchronous procedure call roots. That is, in a peer-to-peer relationship, shouldn't the pre and post conditions be symmetric? If that were so, wouldn't compatibility be much more restrictive? That is you can only be conservative in all your communication since everyone is equally a sender?
For example, Liskov's Substitution Principle is applicable to request-response kinds of interactions. That is when a component is on the server side, it should liberally ignore thing it doesn't understand and conservatively respond to only what it knows. From the client point of view, as the principle states, it should be oblivious to the implementation. However, could similar guidelines be enforced on the client side to ensure compatibility? I mean, if you know that the server is going to be liberal, wouldn't you also be liberal in what you request?
The resolution to this conundrum may be to take a second look at Speech Acts (aka Communicative Acts). See, it's not the asynchronous nature of communication that defines the semantics, it's the content of the messages that does. Compatibility is ultimately based on the semantics of the message. Its possible that differect kinds of principles for compatibility can be associated with each kind of message interaction.
Last modified 2004-06-18 09:44 AM

