The Artima Developer Community
Sponsored Link

Separating UI and Functionality
The Flexible Way to Architect a Jini Service
by Bill Venners
October 1999

<<  Page 2 of 5  >>

Advertisement

Prior-Knowledge Clients

One reason for keeping UI out of the service object is that it enables clients to access the service without human intervention or supervision. Clients written by programmers who knew about the (potentially well-known or standard) interface of a particular service object can interact with a service directly. As shown in Figure 1, client code can interact with a service directly by invoking the methods in the service object interface. Such a client is called a "prior-knowledge" client, because the programmers of such a client had to know about (have prior knowledge of) the service object interface.


Figure 1. A "prior-knowledge" client talks to a service through its object interface.

Prior-knowledge clients need not be completely devoid of a user. For example, a user could be using a device that acts in certain cases as a prior-knowledge client. Were the user to request that the device quickly print something, the device could go get a printer service object and directly invoke the (not quite yet) well-known print() method on the printer service object, with no further intervention of the user. In this case, the device acts as a prior-knowledge client even though it has a user, because the programmers of the device had prior knowledge of the printer service object interface and used this knowledge when programming the device.

On the other hand, prior-knowledge clients can also operate entirely independently of human supervision or intervention. Such clients act as "autonomous agents," which decide for themselves when to enlist the help of services. When an autonomous agent uses a service, it invokes the methods offered by the service object interface directly. Thus, the programmers of an autonomous agent must have prior knowledge of the service object interfaces their agent uses.

<<  Page 2 of 5  >>


Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us