Apple WebObjects 3.5 Manual de usuario Pagina 80

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 120
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 79
Chapter 3 Creating a WebObjects Database Application
80
Examining the Variables
1. Double-click Main.wo in Project Builder’s WebObjects 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.
movieDisplayGroup’s
entity 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
EnterpriseObject—a Java interface that describes the general behavior that
all enterprise objects must have.
/** @TypeInfo Movie */ protected EnterpriseObject movie;
At run time, movie is a GenericRecord object. Recall that GenericRecord
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
defaults to using GenericRecord for all its entities.
The comment (
/** @TypeInfo Movie */) is used by WebObjects
Builder to identify
movies entity (Movie). Knowing the entity allows
WebObjects Builder to display
movies attributes (category, dateReleased, and
so on). You can see
movies attributes if you select the movie variable in the
WebObjects Builder’s object browser.
3. In Project Builder, examine
movieDisplayGroups declaration in Main.java.
The declaration (shown below) declares
movieDisplayGroup to be a
DisplayGroup.
protected DisplayGroup movieDisplayGroup;
Vista de pagina 79
1 2 ... 75 76 77 78 79 80 81 82 83 84 85 ... 119 120

Comentarios a estos manuales

Sin comentarios