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.
You might also like to view...
Which of the following malware can monitor network traffic and take a snapshot of the target system?
A) Flame B) Smurf C) Ping of Death D) My Doom
Which of the following statements about semaphores is true?
a) P and V operations should be indivisible operations. b) If several threads attempt a P( S ) operation simultaneously, only one thread should be allowed to proceed. c) A semaphore implementation should guarantee that threads do not suffer indefinite postponement. d) all of the above
Which of the following is not true about TrueType fonts?
A) They must be downloaded from the Web. B) They print smoothly at any point size. C) They are scalable. D) They are supported by Windows.
The main objective of a sample is to ensure that it represents the overall population accurately.
Answer the following statement true (T) or false (F)