A system and method are disclosed, according to which, the responsiveness
of client/server-based distributed web applications operating in an
object-oriented environment may be improved by cofetching read only
commands. In an exemplary embodiment, the system and method are
implemented by defining special preExecute and postExecute methods of
cacheable commands. The preExecute method of a requested command may be
invoked to execute secondary commands and then return them to the
requesting client. The postExecute method of a requested command may be
invoked to place the returned commands in a cache, along with the
requested command. In this manner, a single request can be used to
execute, retrieve and cache multiple related commands. Cofetched commands
are designated by the application developer when the requested command and
its associated methods are created, and may be chosen based on their
anticipated use in conjunction with the requested command. For example, a
log-on command may cofetch other user authentication commands, since they
are generally required immediately after the user logs on. Cofetching
avoids the need to issue a separate request for every command.