In this chapter you looked at delegate classes. Delegates have the following characteristics:
Each delegate provides a local proxy for a remote service.
Each delegate serves as a contract between client and server development teams.
They may hide underlying implementation details, including:
Client-side service lookups
Server API method invocations
Formatting of method arguments
Delegates allow for mock services and dummy data to be used while server implementations are resolved.
They should be used only in the Control layer.
No classes or interfaces for delegates are provided in the Cairngorm framework; delegates are simply used as a convention.
The location of delegate classes will vary according to the example that you look at, but they are generally found in a business package. The standard naming convention is to prefix the word delegate with something descriptive of the types of services the delegate handles.
The constructor of a delegate allows for the specification of an IResponder class that will handle the results of any remote calls. Each additional method on the delegate represents a particular type of action that can be performed using the service.