The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search

Trail: Putting It All Together
Lesson: BINGO!

The Primary Classes

The Engine of the Game

The following is a diagram of the classes that make up the Game's "engine":


This figure has been reduced to fit on the page.
Click the image to view it at its natural size.


Note: This diagram does not include all of the classes that comprise the Game application. Rather it just shows the key classes. Later pages in this lesson include other diagrams that show the some of the relationships between the other classes.
The BINGO class contains the main method for the Game application, so let's begin there. BINGO creates a RingMaster object. The RingMaster is the most central object of the Game application and provides much of the code that glues everything together. The RingMaster creates many helper objects such as the NotaryPublic for signing BINGO cards, the Roster for keeping track of registered players, and so on.

The main method also creates three other objects: a RegistrarImpl object (which handles all RMI requests from Players), and a ControlPane and an OverallStatusPane (both of which implement parts of the Game's user interface).

When the user clicks the Let the Games Begin button, the ControlPane creates and starts a GamesThread which creates and starts a new BallAnnouncer for each game.

The Game's User Interface

The following is a diagram of the classes that implement the Game's user interface:


This figure has been reduced to fit on the page.
Click the image to view it at its natural size.

The classes above and to the left of the swoosh are in the bingo.game package. The classes below and to the right of the swoosh are in the bingo.shared package because they do not depend directly on any code in the Game and they can be shared by the Player (as LightBoardPane and GameStatusLabel are).

The best way to understand the classes that make up the Game's UI is to identify the areas of the user interface that each class controls. So, here's a box diagram that shows you what class controls each area of the Game's user interface:

[PENDING: put in a snapshot of the game with callouts indicating which classes control which part of the window]

Using the JFC to Implement the UI's contains similar box diagrams, but instead of showing the BINGO classes that implement each area of the user interface, they show you which Swing components are used in the GUI elements (either because the classes shown here create Swing objects or subclass the classes).

The Player

The following is a diagram of the classes that make up the Player application:

[PENDING]

A Legend of the Symbols Used in the Diagrams


This figure has been reduced to fit on the page.
Click the image to view it at its natural size.


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search