![]() |
![]() |
![]() |
|||||||||||
| Strong Synchronizing with external Resources < The Trick is To Keep Breathing < < Home | |||||||||||||
|
Strong Synchronizing with external ResourcesEncapsulating an external resource is done with a driver which offers a virtual map as topicmappish view: {
my $tm = new TM ('> dns:192.168.0.1 >');
...
# work with the map, any access goes actually through to the DNS resolver
}In the above case, a driver for the DNS (domain name service) will be tied to the topic map object. All accesses to this topic map will be translated into DNS requests directed to a DNS server running on the given host (here 192.168.0.1). The results will be returned into the application as topic map data. Theoretically, depending on the implementation of the driver, it may also be possible to write data to the topic map; in that case, the driver will then need to update the DNS server information. In any case, the use of > .... > in the constructor will tell the TM infrastructure that you wish to couple the resource strongly into your application. Theoretically this works with every resource, also with files my $tm = new TM ('> file:some.atm >');
although the costs of synchronizing with sequential files are usually quite prohibitive.
|
||||||||||||