CORBA experience: the use of java and C + + programming mixed (1)
1. Preface
Now many people in the CORBA learning, we all have learned that CORBA is a completely intermediate language, you can use the interface definition language (IDL) definition of the use of interface development and the achievement of the Client Server interface of the information needed by the . Client and Server code is not a concrete realization of the IDL definition of preparation, but the use of some kind of target language IDL compiler generates the necessary code stubs and helper category, Client and Server to use the real programming language to a concrete realization.
In order to ensure that different products based on the CORBA distributed object can be constructed mutual communication, Client and Server through ORB (Object Request Broker) communications. The process is generally run Client ORB sent to the request, then the request sent to the ORB Server, Server returns the results sent the ORB, ORB then returns the results sent to the Client. ORB can be said between the Client and Server translator. Even Client and Server use different programming languages, as long as they are consistent with the same IDL definition ORB can be completed mutual communication.
In all the documents that the server and client can also be a Java C + + or other languages (such as: Delphi) prepared, but no sites or books that detail how to deal with multi-language client example. "JAVA2 core technologies" that some of the above, it is only an introductory article, it downloaded omniORB304 their own, the first use of the tnameserv SUN naming service procedures, prepared with JAVA server, the client separately with JAVA and C + + (+ omniORB VC6) prepared Test hopes to operate a specific example of programming experience to understand or CORBA thinking.
Overall the preparation process is as follows:
IDL interface definitions with a document to describe the functions, it can be said that the definition of a function to achieve a template (SysProp.idl)
"IDL to Java" compiler (here IDLJ) IDL files into Java programming language in the preparation of the interface definition, generates the necessary code stubs and helper category
The use of the Java language to prepare the client and server to achieve procedures.
"IDL to C + +" compiler (here omniidl) IDL document will be translated into C + + programming language in the preparation of the interface definition, generates the necessary code stubs and helper category
Using the C + + language prepared by the client to achieve process (of course, can also be prepared by the server programs, but did not conduct this test)
Starting Naming Service tnameserv
Starting the service program written in Java
Using Java and C + + were prepared by the client calls the corresponding service
2. Operating environment settings:
Overall environment by jdk1.3 + omniORB3.0 (www.uk.research.att.comomniORBdoc3.0) + vc6 composition below specific installation.
2.1. Installation JDK1.3
SUN DOWN JDK1.3 from the company or through other means jdk1.3 be installed, then the corresponding set environment variables, in this paper, the computer test is as follows:






