Sponsored Link •
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.
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
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)
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.