Grid example


Grid is a simple example that demonstrates the programming with VBOrb.
In directory /vb/demo/grid of VBOrb you will find the grid client.
In directory /vb/demo/grid_server of VBOrb you will find the grid server.
File /vb/demo/grid/grid.idl describes the interface of the server object.

First Step

The first step to develop a CORBA program is to describe the interface between client and server. This usually happens by writing a file in CORBA IDL (Interface Definition Language). The interface of the Grid example is shown below.

// grid.idl, IDL definition of a 2-D grid

module grid // I call the module like the project grid
   interface MyServer // Name of the grid object
      readonly attribute short height; // height of the grid
      readonly attribute short width;  // width of the grid
      // set the element [n,m] of the grid to value:
      void set(in short n, in short m, in long value);
      // return element [n,m] of the grid:
      long get(in short n, in short m);
      // A grid client should be able to shutdown the server
      oneway void shutdownServer();

Describing an interface in a file is static. CORBA also knows a dynamically way to describe an interface.

Second Step

The second step to create a CORBA program is to compile the interface definition to the desired programming language. For Visual Basic the only compiler I know is my IDL2VB. If you want to write your client or server in C++ or Java you will find many kind of compilers in the internet.

A CORBA program can be client or server or both. The grid example consist of a server exporting an interface and a client calling that interface.

Writing the grid server

To implement an interface a server needs skeletons or use the DSI (Dynamic Skeleton Interface). The grid interface is staticaly so the IDL compiler generates the
.....under construction...

Writing the grid client

Writing the grid client is simple because a remote interface appears to be a local Visual Basic object. The ORB delivers application requests to the right objects no matter where they live. First you need only one instance of the cOrbImpl object.

This page is under construction

If i will have more time I will explain more about writing software using VBOrb.

explaining narrow, etc