Dynamic Method Binding
From RemObjects Software
This is a Data Abstract Architecture entry
Feel free to add your notes to this topic below.
Dynamic Method Binding (DMB) is one of the major foundations of Data Abstract's architecture. It allows you to connect your Data Abstract client to to any custom defined remote service methods rather than limiting you to the use of the pre-defined interface.
While the predefined IDataAbstractService is sufficient for most standard database applications, Dynamic Method Binding does provide the flexibility to handle advanced scenarios.
Dynamic Method Binding provides a truly object oriented way to fetch data and, at the same time, increases design elegance because it does not restrict data-fetch to predefined (and often rigid) method calls.
Dynamic Method Binding is implemented in the RemoteDataAdapter and RemoteCommand components using descendants of the DynamicRequest Class, providing properties that allow you to dynamically specify the method calls to make for fetching and updating data, retrieving schemas or executing commands.
The RemoteDataAdapter has three properties for mapping DMB calls: DataRequestCall (used by the Fill method), DataUpdateCall (used by Update) and SchemaCall (used by ReadSchema and FillSchema).
The RemoteCommand provides the ExecuteCall property, which is used when calling Execute.
In addition to the standard properties of the DynamicRequest Class, these Calls contain call-specific properties to specify the parameters used for passing in the list of tables, the name of the command to execute, or the the parameter that will contain the returned data.
Examples
Suppose that, in order to read data from your service, you want to use a custom defined method called MyCustomGetDataMethod which takes two input parameters (DataTableNames of type string, and ParameterTwo of type Int32) and returns a Binary stream.
The RODL file included in your server would look somewhat similar to this:
In order for your client RemoteDataAdapter to invoke this method (instead of the default GetData), you will need to make use of Dynamic Method Binding and modify the value of its DataRequestCall’s properties to point to this method.
The first thing you would do is query the remote service for all the available methods by opening the drop down associated with the DataRequestCall.MethodName:
After selecting the appropriate method, the IDE designers will update the parameters contained in the DataRequestCall.Parameters collection and inform you of that through a message similar to the following:
Now you can set the DataRequestCall.OutgoingTableNamesParameter and IncomingDataParameter to the appropriate values like show in the following screenshot:
Once these steps are complete, your RemoteDataAdapter is set up. Any subsequent calls to the Fill method will invoke your custom MyCustomGetDataMethod method on the server.
See Also
- RemoteDataAdapter, RemoteCommand, DynamicRequest classes
- Lists
Product: RemObjects Data Abstract
Current version: Data Abstract 'Vinci' (5.0)
Lists — Glossary — Features — How To — Drivers — Components — Tools — Samples — Articles — Architecture — Issues
Categories: Index | Data Abstract | Architecture | .NET
