Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > Getting Started With WebObjects


   

Examining the Variables

  1. Double-click Main.wo in Project Builder's Web Components category to open the Main component in WebObjects Builder.

    There are four variables in the object browser: the application and session variables that are available in all components and two others, movie and movieDisplayGroup.

    The movie variable is an enterprise object that represents a row fetched from the MOVIE table. movieDisplayGroup is a display group--an object that interacts with a database, indirectly through classes in the Enterprise Objects Framework. Display groups are used to fetch, insert, update, and delete enterprise objects that are associated with a single entity. The entity of movieDisplayGroup is Movie, which you specified in the wizard's "Choose an entity" page.

  2. In Project Builder, look at the class file Main.java to see how movie is declared.

    The movie declaration (shown below) declares movie to be an EOEnterpriseObject--a Java interface that describes the general behavior that all enterprise objects must have.

    /** @TypeInfo Movie */
    protected EOEnterpriseObject movie;

    At runtime, movie is a EOGenericRecord object. Recall that EOGenericRecord is used to represent enterprise objects unless you specify a custom class. Since you didn't check the "Use custom enterprise objects" box in the wizard's "Choose what to include in your model" page, your application uses EOGenericRecord for all its entities.

    The comment (/** @TypeInfo Movie */) is used by WebObjects Builder to identify movie's entity (Movie). Knowing the entity allows WebObjects Builder to display movie's attributes (category, dateReleased, and so on). You can see movie's attributes if you select the movie variable in the WebObjects Builder's object browser.

  3. In Project Builder, examine the movieDisplayGroup declaration in Main.java.

    The declaration (shown below) declares movieDisplayGroup to be a WODisplayGroup.

    protected WODisplayGroup movieDisplayGroup;

    Also note the comment explaining how movieDisplayGroup is initialized. The Main.java class doesn't have any code to create and initialize the display group. Instead, it's instantiated from an archive file, Main.woo, that's stored in the Main.wo component. You shouldn't edit woo files by hand; they're maintained by WebObjects Builder. The woo file archiving mechanism is described in more detail later in Specifying a Sort Order .


© 1999 Apple Computer, Inc. – (Last Updated 24 Aug 99)