An object that receives a functor does not have to "know" anything at all about what operation the functor performs in its Do member function. It simply executes the Do function.
Figure 2 shows how surrogates can mirror any subset of the interface (including the models) of a source document. Figure 2 also shows a surrogate capable of accessing two (A and B) of the source document's four member functions (A, B, C, D). The client has access to a document surrogate that references the source document.
In the example shown above, the client requests that one of the two member functions (function A) defined in the document surrogate be applied to one of the models (1) in the source document.
The functor passes this argument (the member function to be executed) from the context of the surrogate to the context of the source document. The functor executes the member function and then returns the result of the execution to the document surrogate.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.