This chapter describes phases in developing an application and which Digital UNIX tools to use during those phases. Topics in this chapter include the following:
There are five major phases in application development. Table 1-1 describes these phases and the tools and features available for use in each phase.
| Phase | Tools/Features |
| Requirements and specifications |
Standards
Internationalization Security |
| Design |
Routines
Coding Considerations Libraries Common Files |
| Implementation |
vi,
ex,
ed,
lint,
grep,
cxref,
sed,
time,
dbx,
third,
ld,
make,
compilers,
threads
|
| Testing |
diff,
Shell scripts,
pixie,
prof
|
| Maintaining |
setld,
tar,
sccs,
rcs
|
In many instances, the Digital UNIX system offers more than one tool to do a job. The choices of tools and programming languages to use are left to you.
When you design an application, some of your decisions depend on the nature of the application. Digital UNIX provides features and tools to help you create applications that can be portable, internationalized, window-oriented, or whatever is appropriate for the needs of the users of those applications.
One of the primary design considerations concerns adhering to UNIX environment standards and portability. If you want your application to run both on Digital UNIX systems and on other UNIX operating systems, consider limiting your design to features that adhere to X/Open Portability guidelines and POSIX standards.
You might also need to design your application so that it can be used in a variety of countries. The Digital UNIX operating system contains internationalization tools and functions to help you write software to be used by people working in different natural languages.
Another consideration is the terminal environment in which your application will be used. If end users have workstations or window terminals, you might want to design your application to use window displays.
Adherence to programming standards enhances the ability to port programs and applications between hardware platforms or even operating systems. Writing programs according to portability standards makes it easy for users to move between systems without major retraining. As part of program portability, some standards include internationalization concepts.
The following are the primary standards in the UNIX programming environment:
In addition to the standards in the preceding list, the OSF Application Environment Specification (AES) specifies application-level interfaces that an application must provide to support portable applications and the semantics or protocols associated with these interfaces. For more information, see the Application Environment Specification (AES) Operating System Programming Interfaces Volume, ISBN 0-13-043522-8, published by Prentice-Hall, Inc.
Various ANSI standards apply to specific programming tools such as languages, networks and communication protocols, character coding, and database systems. Information on conformance and extensions to a particular ANSI standard appears in the documentation set for the particular language, network system, or database system. For information about compiling C programs to adhere to ANSI standards, see Chapter 2.
The Digital UNIX system allows you to write programs that conform to POSIX and X/Open standards. Information on the POSIX standard is contained in POSIX -- Part 1: System Application Program Interface (API) [C Language] for IEEE Std. 1003.1c-1994. The Digital UNIX header files contain POSIX- and X/Open-conformant information.
An internationalized application provides a run-time interface that allows users to work in their own language with culturally appropriate representations of data. The Digital UNIX operating system provides interfaces and utilities for you to develop internationalized applications that conform to Issue 4 of X/Open CAE specifications.
Considerations for developing internationalized applications include:
To meet these considerations, your applications must not make any assumptions about language, local customs, or coded character sets. Data specific to a culture is held separate from the application's logic. You use run-time facilities to bind your application to the appropriate language message text.
For details about the Digital UNIX internationalization package, see the manual Writing Software for the International Market.
For information on developing window-oriented applications, see the following manuals:
OSF/Motif Programmer's Guide
DECwindows Motif Guide to Application Programming
DECwindows Extensions to Motif
DECwindows Companion to the OSF/Motif Style Guide
Developing Applications for the Display PostScript System
Common Desktop Environment: Programmer's Guide
Common Desktop Environment: Programmer's Overview
Common Desktop Environment: Application Builder User's Guide
Common Desktop Environment: Internationalization Programmer's Guide
Common Desktop Environment: Style Guide and Certification Checklist
Common Desktop Environment: Help System Author's and Programmer's Guide
The Digital UNIX system is compatible with a number of higher-level languages, and it includes tools for linking and debugging programs.
The chief language that the Digital UNIX operating system supports is
C. The Digital UNIX operating system includes a C language compiler.
Other languages, such as Pascal and Fortran, are available separately.
For a complete list of layered products, contact your Digital
representitive. The Digital UNIX system also includes an assembler
for working with assembly language. For more information on the
assembler, see the
as(1)
reference page and the
Assembly Language Programmer's Guide.
In most instances, you can use the compiler driver command
(cc)
to link separate program object files into a single executable program.
As part of the compilation process, most compilers call the linker
(ld)
to combine one or more object files into a single program object
file. In addition, the linker
resolves external references, searches libraries, and performs all other
processing required to create object files that are ready for execution.
The resulting object module can either be executed or serve as input
for a separate
ld
run. (You can invoke the linker separately from the compiler
by issuing the
ld
command.)
Digital UNIX allows you to create applications composed of source program modules written in different languages. In these instances, you compile each program module separately and then link the compiled modules together in a separate step.
Digital UNIX provides the ability to create shared libraries by using
the
ld
command. In addition, you also can create archive (static) libraries
by using the
ar
command. For more information, see
Chapter 4.
See
Chapter 2
and
Chapter 4,
as well as the documentation sets for the individual languages, for
detailed information on compiling and linking programs. For more
information on the
ld
command, see the
ld(1)
reference page.
The following tools are the primary debugging tools on the Digital UNIX operating system:
dbx
debugger
(see
Chapter 5
or
dbx(1)
for details)
third(5)
for details)
lint
utility
(see
Chapter 6
or
lint(1)
for details)
The
ladebug
debugger is also supported on the Digital UNIX operation system.
In addition to supporting the features provided by the
dbx
debugger, it also supports features for debugging multithreaded
programs. For information on the
ladebug
debugger, which supports C, C++, and Fortran, see the manual
Ladebug Debugger Manual
and the
ladebug(1)
reference page.
The
dbx
debugger is the most comprehensive tool for debugging in a nonwindow
environment.
An integral part of creating a software application is managing the development and maintenance processes. The Digital UNIX operating system provides the Source Code Control System (SCCS) utility and the RCS code management system to help you store application modules in a directory, track changes made to those module files, and monitor user access to the files.
SCCS
and RCS on the Digital UNIX operating system provides support similar
to SCCS and RCS utilities on other UNIX systems. In addition,
Digital UNIX has an
sccs
preprocessor, which provides an interface to the more traditional SCCS
commands.
SCCS and RCS maintain a record of changes made to files stored using the utility. The record can include information on why the changes were made, who made them, and when they were made. You can use either SCCS or RCS to recover previous versions of files as well as to maintain different versions simultaneously. SCCS is useful for application project management because it does not allow two people to modify the same file simultaneously.
For more information , see the
sccs(1)
and
rcs(1)
reference pages and the manual
Programming Support Tools.
Once you have created your program or application, you might want to
package it as a kit for the
setld
installation utility so that it can be distributed easily to other
users. The Digital UNIX operating system has several utilities that
you can use to install, remove, combine, validate, and configure
programs and applications.
Software for Digital UNIX systems consists of a hierarchical group
of files and directories. If your application or program consists
of more than one file or directory, you need to determine how the
files and directories are grouped within the hierarchy. The
setld
installation process preserves the integrity of each product's
hierarchy when it is transferred from the development system to a
production system (that is, when the product is installed).
The kitting process includes grouping the component files for the
product into subsets, allowing the system administrator to install
some or all of them as needed.
Using the
setld
utility and its related tools provides the following benefits:
The
setld
utility verifies each subset immediately after it is transferred from
one system to another to make sure that the transfer was successful.
Each subset is recoverable, so you can reinstall one that has been
damaged or deleted.
System administrators can choose which optional subsets to install. Administrators can also delete subsets and then reinstall them later, as needed. You might use this feature to provide multiple language support for your application or to allow users to select among optional features of your application.
The
setld
utility is an integral part of the Digital UNIX installation
implementation.
Using
setld,
you can load your application on any of the following distribution
media for installation on other systems:
For more information on using the
setld
command and creating and managing software product kits, see the manual
Programming Support Tools.
Interprocess communication (IPC) is the exchange of information between two or more processes. In single-process programming, modules within a single process communicate with each other using global variables and function calls, with data passing between the functions and the callers. When programming using separate processes having images in separate address spaces, you need to use additional communication mechanisms.
Digital UNIX provides the following facilities for interprocess communication:
System V IPC includes the following IPC facilities: messages, shared memory, and semaphores.
For information about pipes, see the Guide to Realtime Programming.
For information about signals, see the Guide to Realtime Programming.
For information about sockets, see the Network Programmer's Guide.
For information about STREAMS, see the Programmer's Guide: STREAMS.
For information about programming using threads, see the Guide to DECthreads and Chapter 12.
For information about XTI, see the Network Programmer's Guide.