All this work with damsels and trains is making Eunice feel a bit run down, so she decides to stop working on her characters for a little while, and to work a bit on the main plot.

      Accordingly, she sets her pen to the sheet of paper labeled main routine.

      Here is the main plot of the Gunfight at the Old West Saloon: There is a Western Town called Sweaty Post. Sweaty Post has two saloons, one sheriff, and five troublemakers. There is a male villain named Maurice. Maurice has a black hat, a red mustache, and a horse named "Beer Gut". Maurice prefers Jack Daniels whiskey. Mary is a female human. She has a horse named "Midnight" and she prefers her whiskey straight. In our story, Maurice starts out by drinking whiskey. He then lets everyone know how drunk he is, and then ties up a woman named Mary.



      Here is the main plot of Gunfight at the Old West Saloon;
      In the novel Gunfight;
        There is a town called sweatyPost;
        sweatyPost has two saloons;
        sweatyPost has one sheriff;
        sweatyPost has five troublemakers;
        There is a new villain named maurice;
        maurice has a black hat;
        maurice has a red mustache;
        maurice is male;
        maurice has a horse named "Beer Gut";
        maurice prefers Jack Daniels whiskey;
        There is a new Human named Mary;
        mary is female;
        mary has a horse named "Midnight";
        mary prefers her whiskey straight;
      maurice drinks some whiskey;
      maurice tells us how drunk he is;
      maurice ties up a damsel named Mary



      public class Gunfight {
      public static void main(String arguments[]) {
        WesternTown sweatyPost = new WesternTown();
          sweatyPost.saloons = 2;
          sweatyPost.sheriffs = 1;
          sweatyPost.troublemakers = 5;

        Villains maurice = new Villains();
          maurice.hatColor = "black";
          maurice.mustacheColor = "red";
          maurice.sex = "Male";
          maurice.horseName = "Beer Gut";
          maurice.whiskeyPreference = "Jack Daniels";

        Humans mary = new Humans();
          mary.sex = "female";
          mary.horseName = "Midnight";
          mary.whiskeyPreference = "Straight";
          mary.name = "Mary";

        maurice.drinkWhiskey();
        System.out.println(maurice.howDrunkAmI());
        maurice.tieUpDamsel(mary);
      }
      }


      "That's her book?" you ask yourself. "Ten pages of slogging through ugly yellow text for this?"

      So what is so special about this plot? Well, it's not everything that's happening in the main routine, but rather everything that happens behind the scenes. When Eunice created that town called Sweaty Post, she created (instantiated) an object of type Western Town. This object had all the characteristics of a standard Western Town (do you remember the binders?) The same thing goes for the Maurice object and the (pardon me for this) Mary object. While some of the traits of these objects were specified at the time of creation, most of their traits were specified back in the binders, or classes. This allowed Eunice to say a good deal while only saying a little bit in her main routine.

      So Eunice's main plot (routine) turns out to be nothing more than a collection of references to objects, which in turn are references to classes. It is, to mix metaphors again, literary federalism, with everything being dealt with at the lowest level possible.

      So what are the benefits of this? Well, imagine that instead of one page, Eunice's editor wanted a book of five hundred pages. Or let's say that Eunice decided that Maurice the villain shouldn't be so cruel. Instead of going back and laboriously changing all her instances of Maurice eating kittens and tripping old people (or whatever it is that bad folks do), Eunice could just make some changes to the Maurice object at the time of instantiation. Or she could change the Villain class to be friendlier. Or she could even create a *new* class, called FriendlyVillain with some aspects of the Samuel L. Jackson character in Pulp Fiction. She's got a lot of options; the point is that she only needs to make the changes in one place.

      But that's not Eunice's only reason for writing her books in Java. She has a keen idea for the future of Westerns. She sees interactivity. And if, instead of being bound in pages, her characters live in objects and classes, Eunice is free to create a Virtual Sweaty Post. Readers (on her website) could be prompted for their own actions and her characters could respond in a variety of ways, according to what was written in their classes. Using Java, Eunice could finally bring the Old West back to life. And hey, I'm sure she's not the only one yearning for the days of outhouses, blood, and dust.

      So who is this editor fellow?

      You've seen many references to Eunice's editor in New York. Who is this fellow? Well, he knows the world of Westerns in and out, and he knows that certain things will just not work in a good Western. That is why her editor takes all of Eunice's scripts, reads them, and then returns them with all the errors that she has made (remember, we said that he was a bit persnickety). On the computer, this is called a compiler. All Java programs must be compiled before they can be run. The compiler will patiently (and repeatedly) tell you everything that you did wrong. And then you get to go back and do it again. Hey, that's the literary life.