Modules pattern
A module is a foreign subroutine, where an operation calls on a solicit or notify on a different service. The other service, and the called solicit or notify this service is a client on, is in another configuration tree.
In the example in Table 1, there are two mixes in different configuration trees, with a key-based matching between the services.
Example | Description |
---|---|
<!-- CLIENT SIDE --> <mix name="Client"> <service name="Subr" provision="subr"> <prop name="subr.import" user="some@domain.com" key="any_key"/> </service> ... <request name="myOperation" service="Subr"> ... </request> </mix> <!-- SERVER SIDE (user some@domain.com) --> <mix name="Server"> <service name="Subr2" provision="subr"> <prop name="subr.export" key="any_key"/> </service> ... <solicit name="myOperation" clients="Subr2"> ... </solicit> </mix> |
The operations are identical to the ones in the Subroutines example, except for the
different services. The caller operation is supported by the
Subr
service, that specifies:
The called operation is on the
Subr2 client, that specifies:
Note: If more than one subroutine service is exported with the same key, it is
undefined which one will be matched by an import.
|