EGL interfaces let you access an EGL service, a Web service (which may be written in EGL), or Java™ code.
Interface HelloWorld type JavaObject {javaName = "HelloWorld", packageName = "com.ibm.examples.helloWorld"} function sayHello(name String) returns (String); end
You can create an interface that describes the functionality that you want to have coded in an EGL service. After the interface is complete, you or others can code the service, which is said to implement the interface. The primary meaning is that the service contains every function described in the interface. The interface provides a kind of contract that the service must fulfill.
A service can implement multiple interfaces, and multiple services can implement the same interface.
The runtime effect of declaring a variable of an Interface part is the same as the effect of declaring a variable of the related Service part; but use of the interface lets you avoid disclosing the logic inside the service. Keeping the logic away from others might be appropriate for competitive reasons (you may want to hide the source code from developers outside of your organization) or to reduce complexity (you may want developers -- whether in or out of your organization -- to focus on the functionality that the service provides rather than on the details of the implementation).
Access of a Web service created outside of your organization requires that you have the service-specific Web Service Description Language (WSDL) definition, which details how to access the service.
You use the WSDL definition as input to the EGL WSDL wizard, which creates a service-specific Interface part that will be the basis of a variable in your code.
When you are accessing a service by way of an interface, the interface must be bound to the location where the service implementation resides. This binding includes details on the protocol used to access the implementation.
The usual situation is that you specify the binding information in a variable that is declared in a special type of EGL library called a service binding library, which is described in Library part of type ServiceBindingLibrary. Another possibility is that an interface receives the binding in an assignment statement, as is possible when the interface or service on the right side of the assignment statement is declared in a services binding library or when that interface or service received a binding in a previous assignment statement. A third possibility is that an interface that is acting as a function parameter receives the binding by receiving an argument that already has a binding.
You can use an EGL interface of type JavaObject to access some or all of the functionality that is available in a Java interface or class. In this usage, an EGL interface provides a view of the Java code.
An efficient strategy for your organization is to ask a developer who has expertise in both EGL and Java to create Interface parts for use by other EGL developers. For a list of interface parts that are provided for general use, see Interfaces of type JavaObject.
EGL provides a large set of interfaces to allow Web developers to access JSF user-interface controls at run time; for example, to change the color of a text box in response to a user's input. For an overview of that capability, see JSF component tree.
When you interact with the JSF component tree, you can ignore the fact that (as of EGL version 6.0.1), EGL interface technology does not allow you to instantiate a Java object from within your EGL code. For details on the issue, see Instantiation and EGL interfaces of type JavaObject.
Related concepts
Instantiation and EGL interfaces of type JavaObject
JSF component tree
Library part of type ServiceBindingLibrary