8.10 The Trading Service

In addition to stringified IORs and the naming service, the CORBA specification includes a more advanced and dynamic method of obtaining object references called the trading service . The trading service offers a more discovery-based approach to interacting with remote objects. Instead of interacting with a naming service, the client interacts with a trader. A trader has access to object references in the same manner as a naming service. However, the trader associates descriptions, and interfaces with the object references instead of a simple name. Whereas the naming service contains name/reference pairs, the trader contains descriptions-interfaces/reference pairs. Clients can describe the object they are looking for to the trader and the trader responds with an object reference if a match is found. This a very powerful search method. Not only can the client be unaware of the object's location, it can also be unaware of the object's name . This allows the client to query a trader based on a list of services that it needs instead of looking for a particular object. This allows the client to have a I-don't-care-who-or-where approach. The CORBA specification defines a trader accordingly :

A trader is an object that supports the trading object service in a distributed environment. It can be viewed as an object through which other objects can advertise their capabilities and match their needs against advertised capabilities. Advertising a capability or offering a service is called "export." Matching against the needs or discovering services is called "import." Export and import facilitate dynamic discovery of, and late binding to, services.

In the same way that connecting two or more naming contexts produce naming graphs, connecting two or more traders produce trading graphs. Naming and trading graphs are powerful methods of knowledge and capability representation. Naming graphs and trading graphs provide the foundations for global Web services and telnet services. Traversing naming and trading graphs might include hops that have the potential to visit anywhere on the local network, intranet, extranet, or the Internet. Like naming contexts, traders typically represent certain kinds of objects. For instance, we might have some traders that have access to credit card objects while other traders have access to compression and encryption objects. We can have traders that deal in weather and geography objects. We can have traders that deal in financial and insurance services. If each of these traders were linked, we would have a trading graph. If one trader trades on behalf of other traders, we would have what is known as a trade federation . When a client describes the services that it needs to one trader and that trader then contacts other traders to locate the required services, the client and the trader are involved with a trade federation. This is the most powerful and flexible form of I-don't-care-who-or-where request that the client can perform. When a trade federation returns an object reference it can literally be from anywhere and may be implemented by a servant object(s) whose operating system and language are totally foreign to the client program. Federations of traders provide access to very large and diverse collections of services. Keep in mind that the CORBA standard includes a wireless specification wCORBA. This has tremendous implications for the design of mobile agent and multiagent systems. Figure 8-11 shows the basic architecture of a CORBA-based client/server application that makes requests of traders.

Figure 8-11. Basic architecture of a CORBA-based client-server application that makes requests of traders.

graphics/08fig11.gif

A client program may interact directly with a trader or traders or indirectly with a trader through the federation. Notice in Figure 8-11 that the object reference is obtained and then the interaction with the ORB occurs. Table 8-5 shows common terms used with trader programming.

Table 8-5. Common Trader Programming Terms

Trader Programming Terms

Description

Exporter

Advertises a service with a trader. An exporter can be the service provider or it can advertise a service on behalf of another.

Importer

Uses a trader to search for services matching some criteria. An importer can be the potential service client or it can import a service on behalf of another.

Service offer

Contains a description of the service being advertised. It contains a service type name, object reference, and object properties.



Parallel and Distributed Programming Using C++
Parallel and Distributed Programming Using C++
ISBN: 0131013769
EAN: 2147483647
Year: 2002
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net