Creating a WebObjects
Database Application
One of the most powerful features of WebObjects is its ability to provide access to databases. To do so, it uses a framework called the Enterprise Objects Framework. This chapter introduces you to the Enterprise Objects Framework by showing you how to create a simple database application. The steps you take in creating this application demonstrate the principles you'll use in every other application you develop with the WebObjects and Enterprise Objects frameworks.
The application you'll create in this tutorial is called Movies. It makes use of a sample database, the Movies database, that contains information about movies. In this tutorial we'll use the OpenBase Lite database that comes with WebObjects. If you wish to use another database, you need to set up the Movies database as described in the Post-Installation Instructions. Also, if you aren't familiar with Project Builder and WebObjects Builder, read the first tutorials in this book, Creating a Simple WebObjects Application
and Enhancing Your Application
, which introduce basic concepts and procedures you should know before you go on.
In this tutorial, you will:
-
Use the WebObjects Application Wizard to create a fully functional Main component that reads and writes from the Movies database.
-
Create and configure display groups for interacting with a database in terms of objects.
-
Create bindings between display groups and a user interface.
-
Write code to manipulate display groups' selected objects.
-
Set up display groups in a master-detail configuration.
-
Use EOModeler to maintain a model file.
-
Create custom enterprise object classes.
The Movies Application
Enterprise Objects and the Movies Database
Designing the Main Page
Examining Your Project
Refining Main.wo
Adding the MovieDetails Page
Refining Your Model
Setting Up a Master-Detail Configuration
Updating Objects in the Detail Display Group
Adding Behavior to Your Enterprise Objects
© 1999 Apple Computer, Inc. (Last Updated 24 Aug 99)