The data transfer ("xfer") library is the base for a synchronos or asynchronos access of the business core.
Each access towards the business core functionality (regardless if
that code is executed locally or remote) is wrapped in a request
object (see {@link net.sf.cuf.xfer.Request}), each
request returns a result (see {@link
net.sf.cuf.xfer.Response}).
The result is either valid (then {@link net.sf.cuf.xfer.Response#getResult} will return the result object)
or not valid (then {@link net.sf.cuf.xfer.Response#getError} will return the error object).
This simple but rigid "one request either returns an error or a valid
result" abstraction has proven it's usefulness in various projects.
The request object gets executed by one of the methods of an implementation of the
{@link net.sf.cuf.xfer.Dispatch} interface. The execution
is either synchronous or asynchronous, and one variant dispatches the
result in the Swing EDT (Event Dispatch Thread) or the application thread if JavaFX is used.
An other valuable capability provided by the xfer library is the easy
integration of mock-up code for testing:
If the Java property class name.delegate is set and
references a class that implements the {@link
net.sf.cuf.xfer.RequestDelegate} interface, this
implementation is used to generate the response instead the method
coded in the request object.