摘要 |
The amount of code required to use the command pattern for client-server communications is reduced because, instead of creating separate commands for different actions, instructions required for an action are put into a single, abstract command, along with the required data. The command pattern, an object-oriented design pattern, describes a pattern for encapsulating instructions and data into a single object, called a command. A client application or a dynamic proxy uses the command pattern to encapsulate an identifier of a function to be performed at a server, and first data for use by the server in performing the function, into a command object, and provides the command object to a server host. The server host performs the function by associating instructions with the identifier and executing the instructions, using the first data, to obtain second data, and returns the command object with the second data to the client host.
|