Sample Application Overview
Suggested Configurations
While working through this tutorial we are going to take examples from a small imaginary game application. The game is a simple multi-user distributed game that involves navigating your avatar through an underground maze that contains various dangers and rewards. There is a cave at the end of the maze that contains the final reward that allows the first player that reaches it first to win the game.
Players can issue various commands to the game console to display their surroundings and to have it describe their current location, the contents of the location and a playback of the path that they used to arrive at the current destination. The maze is a randomly generated one that is represented as a cyclic graph (by a cyclic graph we mean that it is possible for there to be loops in the maze, in other words unless you move carefully you can end up going in loops). The game can accommodate as many players as wish to play and the maze complexity can be specified when the first player creates and names a game. There can be multiple games running concurrently, although a player can only play in one game at a time.
To represent the game we will use a number of objects, which are described below:
Game
Each game is represented by an instance of the Game class. Objects of this class contain the name of the game as well as the players and the maze that the game is played in. The Game objects are responsible for generating the maze. Not all of the operations defined on the Game class are shown in this diagram for the purposes of brevity.

A Game object outsources the management of the game to multiple instances of a GameController, which is responsible for managing the state of the game for each player, and therefore each GameController works with one and only one Player. The reason for using the GameController object is to allow distribution of game control functionality in a clean way and allows the control mechanisms to be plugged neatly into several different distribution mechanisms. The GameController can be used by an RMI mechanism, a WebServices / SOAP mechanism, a CORBA mechanism or a JMS mechanism.