Orbix Support in NetExpress | OLE Automation and DCOM |
Object COBOL enables you to send and receive messages to and from objects, using Object Request Brokers (ORBs).
Object COBOL provides a separate domain for objects accessed through each ORB, and an Object COBOL program can access objects from several different domains. The objects accessed through a domain can be written in another language, and can be running in a separate process, although this is not always the case.
The different types of ORB available through Object COBOL provide different levels of functionality. Each ORB is represented by a different domain, and the support for each domain always consists of the following minimum:
Sending messages from an Object COBOL program to an object in a different domain. In this case the Object COBOL program or class is a client to a server object.
Receiving messages from an object in a different (or the same) domain. In this case, the Object COBOL class is a server object, processing requests received through the ORB.
ORBs support a limited set of datatypes when compared with COBOL. Each domain provides a set of automatic type coercions between COBOL datatypes and the datatypes supported by the ORB. Where a COBOL datatype cannot be translated directly to an ORB datatype (for example, edited fields), it is translated to a string.
Some ORBs provide additional services; these are documented for the specific ORBs.
The following sections document the parts of domain support that are the same across all ORBs:
When you want to access a server object in a different domain, you need to identify the domain where it will be found. You do this through the Class-Control paragraph.
class-control. class is "$domain-name$class-name" .
where the parameters are:
domain-name
|
The name of the domain for the object. |
class-name
|
The name by which the class is known to the domain. This is usually determined by the name under which the class has been registered with the ORB for that domain. |
The example code below identifies two class objects, CharacterArray and Excel. CharacterArray is a native Object COBOL object, Excel is an OLE automation server, identified by $OLE$.
class-control. CharacterArray is class "chararry" Excel is class "$OLE$excel.application" .
To start using an instance of Excel, you send the OLE automation server the "new" message:
invoke excel "new" returning anExcelServer
This instantiates the OLE automation server; you can now send messages to anExcelServer.
Once you have identified a class as being in a different domain, you can send messages to it using the INVOKE verb. There is no difference in syntax between using INVOKE to communicate with an Object COBOL object, and in communicating with an object running in a different domain.
Not all COBOL datatypes are supported across different domains though, so parameters may be converted to a different format before being sent with the message. Data casting rules are documented separately for each domain.
Particular message selectors may have special meanings to different domains. For example, message selectors prefixed with "get" and "set" are automatically converted to property set or get operations in the OLE domain. These rules are also documented separately for each domain.
Copyright © 1998 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Orbix Support in NetExpress | OLE Automation and DCOM |