Application Developer's Package for C/C++ User's Guide

Application Developer's Package for C/C++ User's Guide


July 1996

This manual describes how to develop three-tier client/server applications on Windows NT systems for deployment on OpenVMS Alpha systems.

Revision/Update Information: This is a new manual.

Software Version: OpenVMS Alpha Version 7.0




Digital Equipment Corporation Maynard, Massachusetts


July 1996

Digital Equipment Corporation makes no representations that the use of its products in the manner described in this publication will not infringe on existing or future patent rights, nor do the descriptions contained in this publication imply the granting of licenses to make, use, or sell equipment or software in accordance with the description.

Possession, use, or copying of the software described in this publication is authorized only pursuant to a valid written license from Digital or an authorized sublicensor.

Digital conducts its business in a manner that conserves the environment and protects the safety and health of its employees, customers, and the community.

© Digital Equipment Corporation 1996. All rights reserved.

The following are trademarks of Digital Equipment Corporation: ACMS, Bookreader, DEC, DECdirect, DEC Fortran for OpenVMS, DECmessageQ, DECnet, DECset, DECwindows, Digital, ObjectBroker, OpenVMS, OpenVMS Cluster, PATHWORKS, Reliable Transaction Router, VAX, VAX DOCUMENT, VAX C, VAXcluster, VMS, and the DIGITAL logo.

The following are third-party trademarks:

AIX, AS/400, CICS/MVS, IBM, IMS, MVS, OS/2, and PL/1 are registered trademarks of International Business Machines Corporation.

Atria and ClearCase are registered trademarks of Atria Software, Inc.

AViiON is a trademark of Data General Corporation.

BASIC is a registered trademark of Trustees of Dartmouth College, D.B.A. Dartmouth College.

CORBA is a trademark of Object Management Group.

FTP Software is a trademark of FTP Software, Inc.

HP and HP-UX are registered trademarks of Hewlett-Packard Company.

IPX is a registered trademark of Ideographix, Inc.

Intel is a registered trademark of Intel Corporation

IRIX is a trademark of Silicon Graphics, Inc.

Macintosh is a registered trademark of Apple Computer, Inc.

Microsoft, MS-DOS, and Windows are registered trademarks, and Microsoft Windows NT, MS, Visual Basic, Visual C++, Visual SourceSafe, and Windows NT are trademarks, of Microsoft Corporation.

LAN Workplace and Novell are registered trademarks of Novell, Inc.

OMG is a trademark of Object Management Group.

Open Software Foundation is a trademark, and OSF is a registered trademark, of Open Software Foundation, Inc.

OSI is a registered trademark of CA Management, Inc.

PostScript is a registered trademark of Adobe Systems Incorporated.

SCO is a trademark of Santa Cruz Operations, Inc.

Solaris and SunOS are registered trademarks of Sun Microsystems, Inc.

Stratus is a registered trademark of Stratus Computer, Inc.

Tandem is a registered trademark of Tandem Corporation.

TGV is a registered trademark of TGV, Inc.

UNISYS is a registered trademark of Unisys Corporation.

UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Ltd.

Wind/U is a trademark of Bristol Technology's, Inc.

X/Open is a registered trademark of X/Open Company Ltd.

All other trademarks and registered trademarks are the property of their respective holders.

ZK6483


Contents


Preface

Intended Audience

The intended audience for this document is C and C++ programmers with experience in software development on Windows NT and OpenVMS Alpha systems.

Document Structure

This manual comprises the following chapters and appendixes:

Related Documents

For additional information on the Open Systems Software Group (OSSG) products and services, access the Digital OpenVMS World Wide Web site. Use the following URL:

http://www.openvms.digital.com 

For additional information on the Application Developer's Package for C/C++, use the following URL:

http://www.openvms.digital.com/openvms/products/appdevpkg/index.html 

Sample Application Restriction

The Application Developer's Package Sample Application is provided "AS IS" without warranty. Digital imposes no restrictions on its distribution, nor on the redistribution of anything on it. Be aware, however, that some of the products referenced in the documentation and in the sample application may carry restrictions on their use imposed by the original authors or copyright owners. THEREFORE, YOU SHOULD CAREFULLY READ THE DOCUMENTATION ACCOMPANYING THE PRODUCTS.

Digital Equipment Corporation is providing this software free of charge and without warranty. Digital makes no claims about the quality of this software.

It is provided to the customer as a free service.

How To Order Additional Documentation

Use the following table to order additional documentation or information. If you need help deciding which documentation best meets your needs, call 800-DIGITAL (800-344-4825).



Conventions

The name of the OpenVMS AXP operating system has been changed to the OpenVMS Alpha operating system. Any references to OpenVMS AXP or AXP are synonymous with OpenVMS Alpha or Alpha.

In this manual, every use of DECwindows and DECwindows Motif refers to DECwindows Motif for OpenVMS software.

The following conventions are also used in this manual:
Return In examples, a key name enclosed in a box indicates that you press a key on the keyboard. (In text, a key name is not enclosed in a box.)
... Horizontal ellipsis points in examples indicate one of the following possibilities:
  • Additional optional arguments in a statement have been omitted.
  • The preceding item or items can be repeated one or more times.
  • Additional parameters, values, or other information can be entered.
.
.
.
Vertical ellipsis points indicate the omission of items from a code example or command format; the items are omitted because they are not important to the topic being discussed.
( ) In command format descriptions, parentheses indicate that, if you choose more than one option, you must enclose the choices in parentheses.
[ ] In command format descriptions, brackets indicate optional elements. You can choose one, none, or all of the options. (Brackets are not optional, however, in the syntax of a directory name in an OpenVMS file specification or in the syntax of a substring specification in an assignment statement.)
{ } In command format descriptions, braces indicate a required choice of options; you must choose one of the options listed.
italic text Italic text indicates important information, complete titles of manuals, or variables. Variables include information that varies in system output (Internal error number), in command lines (/PRODUCER= name), and in command parameters in text (where device-name contains up to five alphanumeric characters).
UPPERCASE TEXT Uppercase text indicates a command, the name of a routine, the name of a file, or the abbreviation for a system privilege.
Monospace type Monospace type indicates code examples and interactive screen displays. In the C programming language, monospace type in text identifies the following elements: keywords, the names of independently compiled external functions and files, syntax summaries, and references to variables or identifiers introduced in an example.
- A hyphen at the end of a command format description, command line, or code line indicates that the command or statement continues on the following line.
numbers All numbers in text are assumed to be decimal unless otherwise noted. Nondecimal radixes---binary, octal, or hexadecimal---are explicitly indicated.


Chapter 1
Introduction

This chapter introduces you to three-tier client/server computing and the Application Developer's Package for C/C++.

1.1 Three-Tier Client/Server Computing

Digital has teamed with Microsoft to strengthen the existing synergy between the unequaled, bet-your-business capabilities of OpenVMS and the growing library of Windows NT applications. Digital is building on the natural affinity between OpenVMS and Windows NT by enabling customers to run Windows NT applications in combination with OpenVMS applications and databases. Simplifying the integration and management of these complementary environments will soon bring them to the point where users, applications, developers, and system managers can view both as a single environment.

The full potential of combining OpenVMS with Windows NT is realized through the implementation of a three-tier client/server model of computing. Most two-tier models, comprising desktop clients and departmental servers, do not achieve the optimal flexibility that three tiers offer. Three-tier client/server implementations with the model shown in Table 1-1 provide maximum flexibility and the ability to scale to large, enterprise environments.

Table 1-1 Three-Tier Model of Computing
Tier System Role
1 Enterprise server Data management
2 Local server Business logic
3 Desktop client GUI

In a three-tier environment, the user interface and individual productivity applications, such as Microsoft Windows, are typically provided on the desktop. Depending on your requirements, middle-tier server applications can be provided on server systems such as OpenVMS Alpha or Windows NT. Other server applications are provided on high-powered server platforms, such as OpenVMS Alpha systems.

Further advantages of three-tier client/server computing are:

1.1.1 Three-Tier Client/Server Computing Over a WAN

Many companies are already implementing client/server computing, enabling modules of software with different functions, running on different platforms, to work together across a network. Companies or organizations with facilities that are distributed over a broad geographic area need to have computing resources close to the people who need them. The client side of the application may run at the desktop, while the servers at various sites are connected to the headquarters' computing environment. The headquarters' computing environment provides resources that are too expensive to put in every facility; for example, a central information archive (data warehousing), input/output devices, and control point or coordination for distributed information.

1.2 Development on OpenVMS and Windows NT

Using the three-tier model of computing makes it easier to deploy applications where they run best. New software, tools, middleware, and services from Digital and its partners will make it increasingly easy to develop, deploy, integrate, and manage applications across OpenVMS and Windows NT in a three-tier client/server environment.

Figure 1-1 illustrates the process of developing source code on a Windows NT workstation for deployment on an OpenVMS system.

Figure 1-1 Windows NT Development for Deployment on OpenVMS



1.2.1 Development Advantages of Three-Tier Systems

From a development perspective, the advantages of three-tier client/server computing are:

1.3 Application Developer's Package for C/C++ Sample Application

The Application Developer's Package for C/C++ sample application is provided with the Application Developer's Package for C/C++ kit and illustrates the necessary steps in cross-platform development for a two- or three-tier client/server application. The sample application is not intended to be production-quality software. However, developers can use parts of the code in a real application.

The sample application is a namespace manager. The namespace server is a repository of network address information for other application services. An application server on the network can register the service it provides. This information includes the following:

Once the application server has registered itself with the namespace manager, any client system that needs to locate a suitable server can first ask the namespace manager for the list of all available servers for that client.

Note that the sample application is basically two tiered. However, you can use the techniques shown to develop three-tier systems as well.

1.3.1 Tools Used in the Development of the Sample Application

The following software was used in the development of the sample application:

1.4 Roadmap of This Document

This document contains information for several types of audiences, including engineering managers, software developers, and product managers. The following table shows how this manual is organized and suggests the appropriate audience for each chapter.
Reference Audience
Chapter 1, Introduction All
Chapter 2, Overview of Middleware Technologies All
Chapter 3, Software Development Using Middleware Technologies All
Chapter 4, Development Process Software developers
Appendix A, Sample Application Modules Software developers
Appendix B, Middleware Tools and Support All


Note:

The Application Developer's Package sample application is provided "as is" without warranty. Digital imposes no restrictions on its distribution or on the redistribution of anything on it. Be aware, however, that some of the products referenced in the documentation and in the sample application may carry restrictions on their use imposed by the original authors or copyright owners. THEREFORE, YOU SHOULD CAREFULLY READ THE DOCUMENTATION ACCOMPANYING THE PRODUCTS.

Digital Equipment Corporation is providing this software free of charge and without warranty. Digital makes no claims about the quality of this software. It is provided to the customer as a free service.



Chapter 2
Overview of Middleware Technologies

This chapter describes some of the middleware products that you can use to develop three-tier client/server applications on Windows NT and OpenVMS systems. Chapter 3 provides code examples for selected products.

2.1 Introduction

With the industry momentum of Windows NT as a LAN and applications server, Windows NT is becoming the platform of choice for many applications and PC services. The high availability, integrity, security, and scalability of OpenVMS make it the natural partner for Windows NT, providing a powerful and virtually unlimited high end.

Digital provides a broad set of middleware products to support and simplify the implementation of three-tier client/server environments. These tools focus on infrastructure services, application integration, and transaction services. This chapter summarizes which of Digital's middleware is best suited for environments for which integration of OpenVMS, Windows NT, and Windows is the solution of choice.

2.1.1 What Does Digital Middleware Provide?

Digital middleware provides common interfaces to facilitate development and integration of three-tier client/server applications. It supports and simplifies OpenVMS and Windows NT integration by providing the following:

2.2 Middleware Product List

The critical considerations in the selection of the middleware are the application requirements and the skill set of the architect and the implementers. To write applications for selected middleware, application developers must have training in the appropriate tools at the programming level. If a company or organization does not have programmers with the necessary training, implementation using a new or unfamiliar software technology may require a long ramp-up time.

This section describes each middleware product, its best uses, and its advantages and disadvantages.

2.2.1 ObjectBroker (CORBA)

Based on both the Object Management Group's (OMG) CORBA standard and Microsoft's OLE integration technology, ObjectBroker provides an object-based infrastructure and transparent interoperability between PCs and servers.

CORBA, the Common Object Request Broker Architecture, is a specification for distributed object-oriented computing that has implementations from several major software vendors. By using CORBA's model, you can tie together applications running on many different types of computers that are connected by one or more types of networks.

With support for 20 platforms, its powerful wrapping, or encapsulating, capability enables new and existing applications to work together in a heterogenous environment, without changes to application source code.

Who needs ObjectBroker?

Your company might use ObjectBroker if:

Does ObjectBroker support multivendor interoperability?

ObjectBroker software is available for more than 20 multivendor platforms as well as for Digital UNIX.

What do customers need to develop or deploy across OpenVMS, Windows NT, and Windows?

One platform-specific ObjectBroker development license and supported compiler software are required for each computer that is used to develop, compile, or link applications.

To deploy ObjectBroker, the appropriate platform-specific run-time license is required for each computer included in the deployment. In addition, you should have in place the prerequisite operating system and network transport software.

Table 2-1 lists the advantages and disadvantages of using the product.

Table 2-1 Advantages and Disadvantages of Using ObjectBroker
Advantages Disadvantages
Good match for programmers with C++ and object skills. No failover.
Technology that is here to stay: applications built around the Common Object Request Broker Architecture (CORBA) today can tie in to the Network OLE environment of the future. No load balancing.
Multivendor interoperability.
Integrated security with Digital's product but not standard throughout the industry.
Integrated name service.
Automated data marshaling and unmarshaling.
Multiple network protocols supported.
Provides a way to integrate existing applications into new processes without source code changes.

2.2.2 Distributed Computing Environment (DCE)

DCE provides comprehensive infrastructure services for heterogeneous environments, including security services, directory services, distributed time service, and Remote Procedure Call (RPC) for synchronous communications. In addition to DCE for Microsoft Windows NT, Microsoft RPC is available on Microsoft Windows NT.

Who needs DCE?

Your company might use DCE if:

Does DCE support multivendor interoperability?

Most major system vendors provide DCE for their platforms. Digital provides a strong DCE product set for Digital UNIX as well as for Windows NT and OpenVMS.

What do customers need to develop/deploy across OpenVMS, Windows NT, and Windows?

To develop DCE-based applications, an Application Developers' Kit and a C/C++ compiler is needed for each heterogeneous platform on which the software is deployed.

To deploy a DCE-based application, each system participating in the DCE environment must have run-time services software installed. To provide directory services and security services, Cell Directory Server software and Security Server software must be installed on at least one system in the DCE environment. Each participating system must be running the prerequisite platform software and network transport software.

Table 2-2 lists the advantages and disadvantages of using the product.

Table 2-2 Advantages and Disadvantages of Using DCE and RPC
Advantages Disadvantages
Well-understood programming paradigm: function calls. No failover: requires both the server and the client to be available.
Multivendor interoperability that is thoroughly tested. No load balancing.
Integrated security. Not object oriented.
Integrated name service.
Multiple network protocols supported.
Automated data marshaling and unmarshaling.

2.2.3 DECmessageQ

DECmessageQ allows messages to be sent from one application to another through a message bus that uses advanced queuing. It guarantees application-to-application communication among multivendor systems and is ideal for applications requiring "fire and forget"communications. DECmessageQ also queues deferred processing requests (for example, mobile clients).

Who needs DECmessageQ?


Next page... | Contents