Global Positioning System Reference
In-Depth Information
The general ROAF development is driven by the real-world aspect and
the RO hierarchy should classify real physical objects. Things can be
grouped together according to common characteristics and separated from
things with differing characteristics. The classification should be based on
existing scientific organization. The objects in the hierarchy have to be
precise to spare developers from coding general knowledge.
14.5
Decouple Mature ROs
The
roaf.ros
package is the heart of the ROAF and its
RealObject
is the
main actor of any real-world application. The
RealObject
is the fundamen-
tal object with built-in connectivity and GPS traceability under the hood.
For a general understanding, the RO and the ROAF are related in a way
that is analogous to the
JComponent
in the
javax.swing
framework described
in Chapter 6.
In terms of real-world programming, the
roa.ldn.client.LCPlayer
is a
dead end. The player is dedicated to the board game and is prepared to
implement game intelligence. Analogous to the gradual transition from a
board game to a more realistic scenario described in the last chapter, the
RealObject
can be gradually decoupled from its environment.
The players in
LondonChase
actually move by using some kind of vehicle.
To reflect the real world, the scenario should be composed of
RealPerson
s
using
RealVehicle
s as the base class of
RealTrain
s,
RealBus
ses, and
RealCab
s, as a special kind of
RealCar
s. In addition, the cities provid-
ing the environment for the
CityChase
action have to be modified toward
reality.
For the game of Scotland Yard, this programming effort is a waste of
time, since it doesn't add much value to the game logic and strategy. The
idea of creating
RealObject
is is the separation of internal and external be-
havior and a useful prerequisite for distributed development.
The easiest implementation is the
RealTrain
without the freedom to
choose a route; it has to follow the rails. Since the
RealBus
is tied to a
route, it has to react to the trac. The
RealCab
can basically navigate
through a city and additionally receive customer locations to pick them
up.
Besides creating new
RealObject
s for the
CityChase
scenario, the ROs
can also collaborate and interact. For example, a
RealTrain
can be created
with a number (instances) of cars. Inside the train, a
Conductor
could walk
up and down the train and ask people (players) for their tickets. Again,
this would require
RealPerson
s to get on and off the train, call a cab, etc.
Search WWH ::
Custom Search