Global Positioning System Reference
In-Depth Information
down. The circle indicates the semantic scenario implemented inside the
pre-implemented ROServer.
12.4
Application Layer: RealObjectApplication
ExtendsRemoteObjectsServer
The first step toward writing your own RealObjectApplication is simply to
extend the server to your own application class. The generalized construc-
tion looks something like this:
public class RealObjectApplication
// or specific app name like LondonChase
extends RealObjectsServer
// implements RemoteObjectsServer // implicitly
implements RemoteObjectsApplication
// or specific app name like RemoteLondonChase
{ ... }
We are implementing a simplified version of the game Scotland Yard, called
LondonChase and it is a ROApp. Thanks to object-orientation or reusability,
even this empty class can already be instantiated inside the ServerEngine .
The application designer can override (and hide) the original methods
defined in the roaf classes, for example, like LondonChase.identify overrides
RealObjectsServer.identify .
Client call: identify(RemoteObjectclient) . The pre-implemented
ROServer.identify (page 147) method basically receives a remote refer-
ence to any real object and performs some checks (synchronicity, bounding
box, previously logged in, etc.), creates a server-side object, and put s it
in the ROBox . This general server behavior is useful, and it wouldn't make
sense to rewrite it in the application. LondonChase.identify makes use of
this general method via the super class
// first let ROServer do its part:
ServerInfo response = super.identify( client );
if ( response.info == ServerInfo.ENTRYAPPROVED ) {
// implement application logic and
// modify response accordingly
return response; //
modified ROApp response
}
return response;
// unmodified ROSrv response
}
This way, the server makes sure that the client is some kind of RealObject .
If the server denies the entry, the application should also reject it by
simply propagating the server's response. If the server approves the RO
client, the application can look it up in the ROBox .
The problem is that
 
Search WWH ::




Custom Search