Delegate classifier overview

The capabilities of the Delegate classifier are made available when you code a Delegate type, which is the basis of a variable that references an EGL function.

For example, consider the following statement, which is in a Rich UI handler that you might code:
call myService.myFunction()
   returning to myCallbackFunction 
             onException ServiceLib.serviceExceptionHandler;
The statement calls the function myFunction in a remote service and ensures that an exception handler (a second function) is invoked if the call returns an error. However, ServiceLib.serviceExceptionHandler is not the name of a function. Rather, ServiceLib.serviceExceptionHandler is the fully qualified name of a variable declared in the ServiceLib system library. The variable is based on a Delegate type that is essentially as follows:
Delegate SystemDelegateType
    (exp AnyException in) 
end
In short, a declaration similar to the following one is found in the ServiceLib system library:
   serviceExceptionHandler SystemDelegateType;
The mechanism provides flexibility:
The function you might have written has the following outline:
Function myExceptionHandler(exp AnyException in)
   ;
end

Please note that the characteristics of the myExceptionHandler function are the same as the characteristics of the SystemDelegateType type. That is, the SystemDelegateType type describes a function that accepts a single parameter of type AnyException and does not return a value. That sameness is what enables you to substitute your function for the one that is used by default.

A Delegate type does not include a stereotype.