Product: OpenFusion Trading Service
Version: ALL
Description:
Why should the Trading Service be used?
Resolution:
We often locate resources by searching for them not by their name, but by searching for a resource that can provide a particular service to us.
For example, we look for a builder who can repair the roof, or for a printer that can print a document in color, or for a telephone service provider with cheap long distance calls.
Rather than searching through the telephone white pages until we happen upon a building firm we recognize, we reach for the yellow pages and call on a business listed in the Building section.
The Trading Service is similar to the yellow pages; it allows objects that can provide a service to register their abilities and it then allows clients to locate those services by describing the functionality they require. From then on, the client deals directly with the service provider object.
While the Naming Service provides a simple mechanism to locate objects ('services') by a name, this can quickly become unmanageable.
For example, consider a system that manages printer queues. We can partition the printers into postscript and non-postscript printers. This is easy to model in a hierarchical manner using the Naming Service. However, if we also want to categorize printers by other capabilities, e.g. color or black and white printing, this becomes more complex. If you then add further categories, such as ink jet or laser printers, the hierarchical model very quickly becomes too complex to manage. Imagine the hierarchy levels that would be needed to categorize printers with varying throughput speed (in pages per minute) this can range from 1 to more than 16 pages per minute!
Using the Trading Service, we would define a service type of 'printer' and specify properties that will allow us to categorize the different printers e.g.
service printer {
interface IDL:PrinterQueue:1.0;
mandatory property boolean postscript;
mandatory property short ppm; // Pages per minute
readonly property Boolean colour;
readonly property Boolean laser;
};
This allows any Trading Service user to query for a printer service based on the printer properties e.g. 'postscript==TRUE and PPM>6'.
You can also specify the order in which the matching service offers are returned.
For the above example, you may want the printer service offerings listed by their throughput speed (PPM). You would specify this ordering as 'max PPM in the query return order criteria.
Therefore, the Trading Service offers an object location facility that is more sophisticated than that offered by the Naming Service. The ability to search for objects on multiple criteria and to control the order of the returned matches greatly increases the flexibility and usability of the Trading Service.
#KnowledgeDocs
#OpenFusion