Availability Guide for Application Design

Designing Applications for Change
Availability Guide for Application Design525637-004
10-19
Using Version-Labeled Interfaces for Intermodule
Communication
As your business grows, the resources used by your application might get distributed
across several nodes in a network. In addition, you might have replaced the terminals
you used to use as your primary user interface with intelligent workstations. At this
point, it might become useful not only to distribute the functions of the server across
different nodes in the network, but also to move some of the functions from the server
to the workstation.
It is significantly easier to distribute the functions of the server if the server was built
from self-contained modules initially.
Modular Design for Ease of Upgrade
Self-contained modules make it relatively easy to change the technology inside the
module. For instance, you can change to a better algorithm by replacing just the
module that executes the algorithm.
Using Version-Labeled Interfaces for Intermodule
Communication
Version-labeled interfaces enable application modules to communicate with each other
even when those modules are at different revision levels. Here, a function is assumed
to be made up of its behavior and its message interface.
For application modules—such as clients and servers or brother processes in a
process pair—upgrade often includes changing the structure of the messages they use
to communicate with each other. Problems occur when you try to perform a phased
upgrade by replacing modules one at a time. The processes are unable to read
messages from each other because the message format is wrong.
Upgrade Using a Phased Approach
The phased approach to upgrade shown in Figure 10-3 on page 10-20 provides one
possible solution. First, the message formats must be designed to be upwards
compatible; that is, version N+1 of the message format must be a superset of version
N. An intermediate step in which both message versions are permissible assists in a
smooth transition without ever needing to take down both modules. The following steps
correspond to Figure 10-3 on page 10-20:
1. Version N of modules A and B communicate using version N messages.
2. Version N+1 of module B is installed. This version knows about the new
information fields in N+1 messages but does not contain the function to use them.
When module A sends messages to module B, module B understands the old-style
messages because its message format is a superset. When module B sends
messages to module A, module A understands the old part of the message but
ignores the new message fields.
3. Version N+1 of module A is installed. Module A now knows about the new
information fields. The processes communicate with each other using version N+1