Constructing the Game

We have created the database, defined the model, tested it, and populated it; now we are ready to build the game around it.

For the first step, we are going to create a one-person version of the Crazy Eights game. That is one without the computer player.

Start by creating a new WebObjects Application project entitled CrazyEights.

Now copy into the project the CrazyEights model that we created earlier. The model is normally placed in the Resources group or folder of the project and it should be associated with the Application Server target.

Fetching Objects from the Database

First, let's define the main variables we need in the Main component. Add the following variables to Main.java:

 protected NSMutableArray deck; protected ...

Get WebObjects® Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.