Chapter III Corba Program Writing Process
3.1 Steps to Develop CORBA
1. Define an IDL
2. Map the IDL interface to C
3. Develop a Server end
4. Develop a Client
5. Run the name service, server and client
3.2 Workflow of the CORBA program
• Define your objects and methods: Use IDL
• Client calls your defined object method
• Call is passed by orb to Server
• Server truly calls your method
• The result is returned along the original road
3.3 Some details of the workflow
3.3.1 Starting Server, waiting for request from Client
After Server starts, it is first generated into a POA (Potable Object Adapter). Then tell PoA, the service he can provide, that is, servant (Server, according to the IDL definition, each object implemented).
Server gets references to each servant from the POA (Object Reference, similar to the handle).
Server announced their services, there are two ways:
Convert the OR to a string and output;
Bind this OR to a simple and easy-to-understand name, which is done by Naming Service.
as the picture shows:
Figure 3-1 Server starts and registered services
3.3.2 CLIENT Call the defined object method
Client gets the reference or (Object Reference) of the object to be accessed by the Naming Service query, or is obtained via an iOR string;
Client calls the object's method of calling the object, because there is enough information to locate an object;
This call is passed to the ORB.
as the picture shows:
Figure 3-2 A client issued a request
3.3.3 Call completion
The CLIENT-side call request is passed to the correct Server end through the ORB, and the positioning is implemented according to the OR;
This ORB handles the call request to the true server;
Server also generates this OR's POA according to the OR positioning, and transmits the request;
POA also passed the request to the last real servant, complete the call and returned.
as the picture shows:
Figure 3-3 Server serves the request