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 part or the related Service part to declare the variable.
Interface IMyService
Function calculate(theList INT[] IN)
returns(BIN (4,2));
// other function prototypes are here
end
myServiceVariable IMyService;
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 EGL 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.
For a description of the tasks involved in service access, see “Accessing a service.”
You can also use an Interface part to describe the functionality that you want to see coded in an EGL service. After the Interface part 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 part. The part provides a kind of contract that the service must fulfill.