This whitepaper provides a brief technical overview of how to design applications which integrate in a client/server environment with the Microsoft BackOffice family of server applications. These guidelines have been carefully selected to ensure that the application you develop takes advantage of the great features provide by the Microsoft BackOffice server suite. Some of these guidelines are not required by your application in order to obtain the Designed for Microsoft BackOffice logo. However it is recommended that you seriously consider utilizing such features as in the future it is possible that the recommended features become requirements. These optional features are indicated via a *. Pointers to additional information such as the Microsoft Developer Network (MSDN), the BackOffice Software Development Kit (SDK) and the Win32® SDK are also provided so that you may quickly find in-depth information on each of these topics.
Common Application Considerations
Before even delving into creating your client/server application one needs to consider the important basics for any application regardless of where the application resides or which end, client or server, the application is targeted for. By utilizing these techniques an application is able to take maximum advantage of the operating system platform it is designed to run on. These techniques don't apply to just client or server based applications but to all applications in general. They have been provided to simply your job of creating an application and enabling your applications to take advantage of some of the powerful features provided. Chances are good that you will use some or all of these techniques in both your client and server based applications. Just like your application will have a core purpose, these techniques provide you with the basic functionality for which you can use the techniques mentioned allow your applications to become more scaleable, manageable and more robust. This is something which is required by all applications in distributed computing environments today.
Being Network Independent
Programming on top of an independent network transport allows the application to focus on the business application detail at hand without having to deal with the complexities of network data transfer. A client application can be designed to take advantage of standard, transport-independent interproccess communications interfaces. This helps ensure that the client and server application programs will be able to run on a wide variety of network platforms with little or no modification.
The Windows NT® operating system currently supports numerous sets of networking APIs that provide this transport independence: the Windows® Sockets interface, remote procedure call (RPC), named pipes and the Distributed Component Object Model (DCOM).
A named pipe is a one-way or two-way pipe for communicating between a server process and one or more client processes. Named pipes are implemented as a file system hence manipulation of named pipes occurs just as with reading and writing to file handles. As part of the file system they share common functionality, such as caching, with the other file systems. Additionally, processes on the local computer can use named pipes to communicate with one another without going through networking components. Remote access to named pipes as with all of the file systems, is provided through the network redirector. Working with named pipes is just like working with file I/O. You can use the same file I/O APIs and simply pass in named pipe handles. Named pipes also support impersonation, which allows a server to change its security identifier so that it matches the client's. Named pipes also give you the ability to perform asynchronous execution known as overlapped I/O. Overlapped operations make it possible for one pipe to read and write data simultaneously and for a single thread to perform simultaneous I/O operations on multiple pipe handles. This enables a single-threaded server process to handle communications with multiple client processes efficiently. Server processes can create named pipes by simply calling CreateNamedPipe while clients can connect to named pipes by using CreateFile or CallNamedPipe. Pipes can then by manipulated by using the usual Read, Write or ReadEx, WriteEx calls or PeekNamedPipe and TransactNamedPipe.
The Windows Sockets API defines a network programming interface for the Microsoft® Windows-based operating system on the "socket" paradigm popularized in the Berkeley Software Distribution (BSD) from the University of California at Berkeley. It encompasses both familiar Berkeley socket style routines and a set of Windows-specific extensions designed to allow the programmer to take advantage of the message-driven nature of Windows. Windows Sockets is intended to provide a single API to which application developers can program and multiple network software vendors can conform. Furthermore, in the context of a particular version of Microsoft Windows, it defines a binary interface such that an application written using the Windows Sockets API can work with a conformant protocol implementation from any network software vendor. This specification thus defines the library calls and associated semantics to which an application developer can program and which a network software vendor can implement. Windows Sockets provides functions which allow you to exchange data from a client to a server. Servers can register services within a name space. Functions are also provided to query the different protocols supported within the system as available services in the name space. The service registration and resolution functionality helps you write client server applications. Using this functionality, a service can register its existence with a name space (registration), and a client can find a service within a name space (resolution).
Microsoft® Remote Procedure Call (RPC) for the C and C++ programming languages is designed to help meet the needs of developers working on the next generation of software for the MS-DOS®, Microsoft Windows®, and Microsoft Windows NT™ family of operating systems.
Microsoft Remote Procedure Call (RPC) represents the convergence of three powerful programming models: the familiar model of developing C applications by writing procedures and libraries; the model that uses powerful computers as network servers to perform specific tasks for their clients; and the client-server model, in which the client usually manages the user interface while the server handles data storage, queries, and manipulation. When you write a client-server application, you must provide the layer of code that manages network communication. The advantage of using Microsoft RPC is that the RPC tools provide this layer for you. RPC nearly eliminates the need to write network-specific code, making it easier to develop distributed applications. Using the remote procedure call model, RPC tools manage many of the details relating to network protocols and communication. This allows you to focus on the details of the application rather than the details of the network. Microsoft RPC is an evolution of the procedural programming model familiar to all developers. Microsoft RPC allows a process running in one address space to make a procedure call that will be executed in another address space. The call looks like a standard local procedure call but is actually made to a stub that interacts with the run-time library and performs all the steps necessary to execute the call in the remote address space. As a tool for creating distributed applications, Microsoft RPC provides the following benefits:
| Providing a Package Definition File | A PDF follows the standard initialization file format. It is an ASCII text file containing keys (the key names are enclosed within square brackets). Key names can be separated by spaces. Each key contains one or more entries, where each entry follows the format: name = value1, value2, ... Values are separated by a comma and at least one space. A PDF has specific keys and entries that are used by the system to set the properties of a package. |
| Unattended Setup | The program must not require input from the user during the installation, removal, or maintenance of the application. Any information or options required by the Setup program should be supplied by command-line switches to the program, or should be provided in a configuration file that is read by the program at run time. Because multiple packages can be installed by Systems Management Server at one time, no individual package installation should force a restart as part of its installation program. To copy system files that may be in use, Setup programs typically construct a batch file containing operations that must be performed during a restart. |
| Providing for Uninstall | The setup program should also include a provision to support the removal of the application owned components, clean up environment settings and registry entries. This is to facilitate software upgrades, retirement, recalls, etc.. The setup program ideally would provide a switch or option as part of the setup procedure supporting Uninstall. |
| Report Status Back to Systems Management Server by Using a Status MIF | To report the status of a PCM application installation, a MIF file must be created in the Windows directory. The MIF file should be named appname.MIF, where appname is the name of the application. In fact, the PCM will pick up any file in the Windows directory with an extension of .MIF (and which was created-timestamped-after PCM began the installation) and send it back to Systems Management Server. |
| use the IDispatch interface | for compatibility with existing OLE Automation controllers who access objects only through IDispatch. |
| use virtual function table (VTBL) binding | faster than both ID binding and late binding because access is direct; no calls are made through IDispatch. |
| use dual interfaces (combination of IDispatch and VTBL binding) | Binding can take place at compile time through the VTBL interface, or at run time through IDispatch. |
| OLE Automation controllers that can use the VTBL interface may benefit from improved performance. | |
| Existing OLE Automation controllers that use the IDispatch interface will continue to work. | |
| The VTBL interface is easier to call from C++. | |
| Dual interfaces are required for compatibility with the Visual Basic® programming system object support features. |
| Messaging-aware applications | A messaging-aware application does not require the services of a messaging system, but includes messaging options as an additional feature. For example, a word processing application can add a "Send" command to its File menu, enabling the user to send a document to another user. |
| Messaging-enabled applications | A messaging-enabled application requires the services of a messaging system and typically runs on a network or an on-line service. An example of a messaging-enabled application is Microsoft Mail. |
| Messaging-based workgroup applications | A more advanced client application is the messaging-based workgroup, or workflow, application. The workgroup application requires full access to a wide range of messaging system services, including storage, addressing, and transport services. These applications are designed to operate over a network without users having to manage the applications' network interaction. Examples of such applications include work flow automation programs and bulletin board services. |