The Movies Application
The application has three pages: "Browse Movies," "Movie Search," and "Movie Details." The Browse Movies and Movie Search pages of the Movies application let you browse the movies that are in a database and search for movies that match user-specified criteria. For example, you can search for all comedies starting with the letter "T" that have an R rating. You can also use these pages to insert, update, and delete movie records.
Enterprise Objects and the Movies Database
Enterprise Objects Framework manages the interaction between the database and objects in the Movies application. Its primary responsibility is to fetch data from relational databases into enterprise objects. The Movies application centers around three enterprise objects: Movie, MovieRole, and Talent. A movie has many roles; actors, or talent, play those roles.
- It has properties that map to stored data; an enterprise object instance typically corresponds to a single row or record in a database.
- It knows how to interact with WebObjects Framework and Enterprise Objects Framework to give and receive values for its properties.
The Movie, MovieRole, and Talent enterprise objects in the Movies application correspond to tables in a relational database. For example, the Talent enterprise object corresponds to the TALENT table in the database, which has LAST_NAME and FIRST_NAME columns. The Talent enterprise object class in turn has lastName and firstName instance variables, or class properties. (Instance variables based on database data are called class properties.) In an application, Talent objects are instantiated using the data from a corresponding database row, as shown in the following figure:
Table of Contents Next Section