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 MyServiceType.myFunction()
   returning to myCallbackFunction 
             onException MyLib.serviceExceptionHandler;
The statement calls the function myFunction in a service and ensures that an exception handler (a second function) is invoked if the call returns an error. However, MyLib.serviceExceptionHandler is not necessarily the name of a function. Rather, MyLib.serviceExceptionHandler might be the fully qualified name of a variable declared in the MyLib system library. The variable is based on a Delegate type that is essentially as follows:
Delegate MyDelegateType
    (exp AnyException in) 
end
In this example, a declaration similar to the following one is found in the MyLib 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.