Define the interface to the Election service in CORBA IDL and Java RMI. Note that CORBA IDL provides the type long for 32 bit integers. Compare the methods in the two languages for specifying input and output arguments.

What will be an ideal response?

CORBA IDL:
```
interface Election {
void vote(in string name, in long number);
void result(out string name, out long votes);
};
Java RMI
We need to define a class for the result e.g.
class Result { String name; int votes;
}

The interface is:

import java.rmi.*;
public interface Election extends Remote{
void vote(String name, int number) throws RemoteException; Result result () throws RemoteException;
};
```
This example shows that the specification of input arguments is similar in CORBA IDL and Java RMI.
This example shows that if a method returns more than one result, Java RMI is less convenient than
CORBA IDL because all output arguments must be packed together into an instance of a class.

Computer Science & Information Technology

You might also like to view...

Left-aligned and ____ are the two most commonly used text alignments in documents.

A. justified B. centered C. right-aligned D. top-aligned

Computer Science & Information Technology

Databases built to support online analytical processing(OLAP) consist of _____.

a. data cubes b. data hubs c. data cards d. data marts

Computer Science & Information Technology