Availability Guide for Application Design

Designing Applications for Change
Availability Guide for Application Design525637-004
10-18
Using a Modular Design
Under What Circumstances Does Data Encapsulation Work
Well?
Data encapsulation is a structured programming technique that will make future
changes to the data layout easier, in most cases. Depending on the tools you are
using, the functions performed by your application, and the specific details of the
anticipated change, data encapsulation works better in some situations than in others.
You must carefully consider how well this technique will work for your purposes. Some
considerations are listed as follows:
Which database management tool are you using?
Using this technique with NonStop SQL/MP, for example, you can perform
extensive changes to your data layout with only minimal application downtime;
refer to Changing a NonStop SQL/MP Program or Database on page 10-27 for
specific details. By contrast, making data layout changes to an Enscribe database
using this technique is much more difficult to do without bringing down the
application. Use of data encapsulation, however, will probably still ease the burden.
Does the program you want to apply this technique to already exist, or are you
developing a new application?
It is hard to apply data encapsulation to existing nonstructured programs. Typically,
a program should be designed this way from the start.
What will be the effect on program maintenance of using this technique?
Data encapsulation might make maintenance easier or more difficult, depending on
the design of your application and on the development and maintenance tools and
procedures you are using.
Encapsulation techniques tend to work better with database access than with data
communications.
Encapsulation techniques do not work well with state-machine implementations.
Using a Modular Design
If you separate your functions into self-contained modules, then it is easier to distribute
your application at a later date or to upgrade your application by replacing just one of
the modules. Object-oriented programming provides useful techniques for modular
design.
Modular Design for Ease of Distribution
Consider, as an example, a server process that performs 20 different functions.
Because all the resources these functions access are currently attached to the same
system, it might make sense to save process-management overhead by containing all
20 functions within the same server process.