The capabilities of the Interface classifier are made available when you code a Interface type, which has prototypes for some or all of the operations provided by a service. That part is the basis of a service-access variable, which is used in the statement that invokes the service.
A second use of the Interface part is as a design tool.
If you accessing a service written in a language other than EGL, you must use an Interface part to declare the service-access variable. If you are accessing a service written in EGL, you can use either an Interface type or the related Service type to declare the variable.
Interface IMyService Function calculate(theList INT[] IN) returns(BIN (4,2)); // other function prototypes are here end
myServiceVariable IMyService;
In this case, you also must declare a variable that is based on BIN (4,2), which is the return type.
average BIN(4,2); average = myServiceVariable.calculate([90, 70, 80]);
call myServiceVariable.calculate([90, 70, 80]) returning to myCallbackFunction onException ServiceLib.serviceExceptionHandler;
A service-access variable is tied to a service binding, which is a definition that identifies the service location and access protocol. The binding can be in the deployment descriptor, and that practice provides the greatest flexibility. If you are invoking a web service, you can set the binding in the code itself.
An Interface type does not include a stereotype.
You can also use an Interface type to describe the functionality that you want to see coded in an EGL service. After the Interface type is complete, you or others can code the service, which is said to implement the interface. The meaning of that phrase is that the service contains every function described in the Interface type. The type provides a kind of contract that the service must fulfill.