Instances of Uniface components can communicate with each other synchronously or asynchronously, either locally (in the same process), or remotely (between different processes, which may be on different hosts).
Component signatures describe the remote interfaces of components. Interfaces enable other components to address the component without knowing anything about the implementation. Signatures for Uniface components are automatically generated during the build process, but it is also possible to import or define the interfaces of third-party components. For more information, see Signatures .
Synchronous communication is two-way—a request from one component is dealt with and returned by the answering component before the initiator of the request can continue processing. Synchronous communication ensures that actions are performed in the correct sequence and that data remains synchronized between client and server.
Components can communicate synchronously by activating operations on another component (first creating the new component instance, if required). Operation parameters convey the required information to and from the activated component. For more information, see activate and Handles.
Asynchronous communication is one-way—the sending component does not wait for a response before continuing. This is useful for parallel processing, such as printing a report while continuing other processing.
Components can communicate asynchronously my means of inter-component messaging. Uniface provides several facilities for this, including the postmessage ProcScript statement. For more information, see Asynchronous Messaging and postmessage .
Components can also be created or activated as asynchronous components using the /async switch with newinstance and activate. This can be useful, for example, for services and reports that do not need to return information to the calling component.
Communication in Web Applications
Asynchronous communication is used in web applications for communication between the client browser and the web server. This can lead to data conflicts resulting from competing parallel requests and responses. Uniface provides techniques and guidelines for avoiding such situations. For more information, see Race Conditions and Data Blocking.
In web applications, synchronous communication can be problematic because it occurs over the internet. This can slow communication and there is no guarantee that the server returns a response at all. Furthermore, there is no constant connection between data in the client and on the server to maintain data state, so special techniques are required to ensure that disconnected data is correctly synchronized For more information, see Disconnected Record Sets.
Component instances that are running in different applications or in different Uniface Server processes do so via the Uniface Router. It is responsible for starting Uniface Servers to execute remote components in response to client requests. The Uniface Router is also responsible for transporting messages between components and maintaining the message queue if the component instance does not yet exist. For more information, see Uniface Application Middleware .