Next Previous Up Top Contents Index

2.1 A CORBA-based Hello World

2.1.1 Defining the interface

We first need to define the interface of the Hello World server object. The client and server will communicate across this interface. The interface is defined using IDL in a single file that must have the extension.idl.

1. Create a file calledhello-world.idl.
2. Enter the IDL declaration below into thehello-world.idl file.
module HelloWorld {
  interface world {
    string hello();
  };
};

This IDL declaration says that there are CORBA objects of a kind calledworld, and that there is an operation calledhello onworld objects that takes no arguments and returns a string. Servers implementworld, and clients callhello on instances ofworld.

Now that we have written the IDL, we can run the IDL parser over it to produce stub and skeleton code for the client and server parts of the application.


Developing Component Software with CORBA - 22 Jan 1999

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker