Mapping Clients  «Prev  Next»
Lesson 4 The operations interface
Objective Describe the Mapping of an IDL interface to a Java operations Interface.

Describe the Mapping of an IDL interface to a Java Operations Interface

The operations interface generated by an IDL compiler is implemented by all the generated stub and skeleton classes. It captures the method signatures of all the operations mapped from the original IDL interface--these methods must in turn be provided by the classes that implement the interface. Ultimately, the server-side implementation classes that you will write must thus implement the operations interface--so you must understand the form it takes.
  • Operations interface mapping
    Because the operations interface includes the method signatures mapped from the IDL interface, and you already learned the basics of method and interface mapping earlier in the course, a simple example will suffice to demonstrate how the operations interface is generated:

Operations Interface Mapping using Corba and Java

1) Simple Mapping Example - Weather Service
We start with an IDL interface and the resulting Java operations interface.
//weather.idl
//Simple mapping example - Weather Service 
module weather{
  interface WeatherService{
    string getReport(in string city);
  };
};
// 2
package weather;
public interface WeatherServiceOperations{
  public java.lang.String getReport(java.lang.String city);
}

2) Public interface WeatherService Operations
The operation interface name is the IDL interface name and "Operations."
// 1) weather.idl
interface WeatherService
// 2) package 
package weather;
public interface WeatherServiceOperations{
  public java.lang.String getReport(java.lang.String city);
}

3) Any interface operations or attributes are mapped to Java methods.
// 1) weather.idl
string getReport(in string city);
// 2) package weather;
public interface WeatherServiceOperations{
 public java.lang.String getReport(java.lang.String city);
}

Any interface operations or attributes are mapped to Java methods.

Operations InterfaceMapping - Quiz

Click the Quiz link below to test your knowledge of operations interface mapping.
Operations InterfaceMapping - Quiz
In the next lesson, you will use the inheritance-based approach to using skeletons for your server-side implementation.