Interface for objects which serve has handles to actual data objects.
The resolve pattern is based on the IAdaptable pattern used extensivly by
the Eclipse framework. Also known as the Extensible Interface pattern,
objects implementing the IAdaptable interface morph or adapt themselves
into objects implementing a different interface.
The resolve pattern is slightly different in that morphing or adapting (ie.
resolving) into a different object involves a blocking call in which I/O
is being performed, possibly with the local disk, or with a remote service.
The following code illustrates the use of the resolve pattern:
Resolve resolve = ....
ProgressListener listener = ....
FeatureSource featureSource = resolve.resolve(FeatureSource.class,listener);
if (featureSource != null) {
//do something
}
As a convenience, the
Resolve.canResolve(Class) method is used to
determine if a particular type of object is supported, but not to perform
the resolve. This method can be useful in situations where it is not
desirable to block.
An implementation of resolve supports the notion of resolving into a parent,
or into a list of children, called members. Like any other resolve, these
are blocking operations. Parents and members must also implement the
Resolve interface.
author: David Zwiers, Refractions Research author: Justin Deoliveira, The Open Planning Project since: 0.7.0 |