The RequestTypeWithOptions class is used to specify a request type, a function name and a set of RequestOptionEnum options. Previous implementations defined a separate attribute for each request type, but that meant that the Dark Matter Protocol could not be extended without defining new attributes. This way, we just specify the class of Request that's being used, so that everything is extensible.
Important Note: it is expected that all requests and responses end with Request and Response! This is because the code generation makes this assumption.
The requestImport and responseImport information must be resolved and set by some resolution mechanism (in most cases, the MvwDefinitionManager).
Example usage:
sendsRequest MyOwnRequest functionName DMPERRORS RPCERRORS CENTRALDMPERRORS CENTRALRPCERRORS CENTRALERRORS
sendsRequest GetRequest functionName DMPERRORS RPCERRORS CENTRALDMPERRORS CENTRALRPCERRORS CENTRALERRORS CACHE EVENTS
sendsRequest SetRequest functionName className DMPERRORS RPCERRORS CENTRALDMPERRORS CENTRALRPCERRORS CENTRALERRORS
sendsRequest DeleteRequest functionName className DMPERRORS RPCERRORS CENTRALDMPERRORS CENTRALRPCERRORS CENTRALERRORS
sendsRequest CreateRequest functionName className DMPERRORS RPCERRORS CENTRALDMPERRORS CENTRALRPCERRORS CENTRALERRORS
The CACHE and EVENT options are only allowable with GetRequests
One other aspect is that the error handling falls back to being centralized for RPC but local for DMP errors i.e. if no error handling flags are set, we fall back to CENTRALRPCERRORS DMPERRORS. This is primarily because is anything goes wrong with RPC, your application is probably cacked and you'll probably want to handle that situation centrally. However, if something goes wrong and you get back a Dark Matter Protocol error, you'll likely want to handle that local to the component that sent the message. This just comes back to having sensible defaults.