Basic content of CORBA (on)
(This article is reproduced from Software Engineering Expert Network www.21cmm.com)
Su Yang
Looking back in the introduction of the CORBA architecture, it has emphasized that CORBA has highlighted features in improving component reuse, enhanced distribution computing function: ● Introducing middleware as a transaction agent; ● The client program is completely separated from the server program; ● A combination of object-oriented modeling concepts; ● Introducing an interface definition language description service object function.
The CORBA specification only describes the basic conditions of each component in the CORBA system and the tasks assumed in the system, and does not specify how to create a CORBA-based software system product from the details of the functional implementation. Thus, for CORBA-based software product development, programming staff can freely choose implementations, provided that the principle of implementation of various components in specifications. In this speech and the next lecture, the main contents of each component in CORBA will be described in detail.
Object Request Agent (ORB) 1. The role of object request agency (ORB, Object Request Broker)
During the traditional client / server-based application development process, project developers follow protocols between public standards or free design modules, depending on the network type, implement language, application, and so on. After introducing ORB, customers will establish a customer-service object relationship between distributed objects as long as the external interface criteria follows the external interface criteria of the service object. Summary, the role of the ORB includes: ● Receive the service request issued by the customer, complete the request to the service object side; ● Automatically set the route search service object; ● Submit the customer parameters; ● Carry the service object calculation result Return to the client.
Figure 1 Directive diagram of customer service request
As can be seen from Figure 1, the client (Client) issues a transaction request to the Object Implementation of the service object, where the customer is an entity that issues a method requested by the service object, and the service object should include the data resources of the method and implement code. The role of the object request agent is to locate the service object, receive the service request sent by the customer and return the execution result of the service object to the customer. After the request is issued, the customer object uses polling and other methods to obtain the result of the calculation of the service object.
2. The structure and type of ORB
ORBs determine the provided services and implementation of customer and service objects through a range of interfaces and interface definitions to implement. Coordination of IDL interface definitions, interface libraries or adapters, orb can provide services to clients and object implementations with service functions (Object Implementation). As the core of the CORBA architecture, ORB can implement the following three types of interfaces: ● Has the same operations for all ORBs;
Different types of interfaces based on ORB implementation, one client request can access multiple object references that implement communication management by different ORBs. In practical applications, as long as the public ORB architecture is followed, the programming can choose from the various implementations of ORB, including:
(1) Client-Implementation Resident ORB: The ORB is implemented in a manner that resides in the customer and service object implementation program. In this implementation, the client can use the pile (STUB) program to present a service request to a particular implementation object in a position transparent manner to implement the communication of the customer and service object.
(2) Based on service (Server-based) orb: customer objects and implementations can communicate with one or more service objects, the function of the service object is to send the request from the client to the object implementation. In this way, the role of the ORB is to complete the communication between the customer object and the implementation of the object, providing a service between the objects. (3) Based on system-based orb: In this implementation, the ORB is considered a basic service provided by the system. Since the operating system understands the position of the call party and the service object, the ORB function can be fully implemented.
(4) Based on library-based orb: If the object implementation can be shared, the implementation function can be placed in the implementation repository, thereby creating a library-based ORB.
3. Main methods in ORB
Both the client and service objects can freely select the method defined in the ORB object to implement the operation. The following is an important method in the ORB object: (1) ORB ORB_INIT (INOUT ARG_LIST ARGV, IN ORBID ORB_IDENTIFIER) Role: ORB initialization method. (2) String Object_to_String (In Object Obj) Role: The object information that converts the reference to the object into object information that can be stored in a string. (3) Object string_to_object (in string STR) Role: The reverse process of the above method. The object stored in a string is converted into a reference to the object type. (4) Object resolve_initial_references (in ObjectID Identifier) The role: Get the initial object reference. (5) Policy get_policy (in policytype policy_type) Relief: Returns the service policy object for the specified type.
As the core content of the public object requesting the agent architecture, ORB provides a fairly rich way. The reader can check the relevant information to learn more about the method in ORB.
4. Implementation of service requests
Regarding the implementation of the object request, the CORBA specification defines the client to use the dynamic call interface (Dynamic Invocation Interface) or by the omg IDL file, the service request is proposed after compiling the client (Stub). The difference between these two implementations is in the call request implemented by the OMG IDL Pile (STUB) file, the client accessible service object method depends on the interface supported by the service object; and the dynamic call interface call mode is related to the service object The interface is independent. Although the way to implement the call request is different, the semantics of the request service call issued by the customer are the same, and the service object does not analyze the way of analyzing service requests.
ORB positions the service object's implementation code, transfer service object application parameters, and control of the request delivery method via the IDL client pile (STUB) method or a dynamic call interface (DII) mode. Object Implement provides a service requested to a customer through an object adapter. The customer's call mode is shown in the call mode of the server.
Figure 2 Implementation of the customer call service request