Table of Contents Previous Section Classes

Classes

A class specifies the type of a variable. There are three types of classes in WebObjects:

  • Base Classes. The base classes are Object, Number, and String. They represent a single value. That is, a variable of the Number class represents a single number, and a variable of the String class represent a single string.

  • Composite Classes. The composite classes are Array and Dictionary. Composite classes represent a group of related values. For example, a Dictionary class named Guest might represent all information about one guest, and an Array of Guest might represent a list of all guests.

    Most of the time when you create a new class in WebObjects Builder, you are creating a Dictionary class. When you define a Dictionary class, you must specify its attributes.

  • Enterprise Object Classes. Enterprise object classes are used in applications that access a database.

Object, Number, String, and Array are all part of the Foundation Framework. For example, if you click the array checkbox when creating a variable, you are creating an instance of NSMutableArray (mutable meaning you can add or delete values). If you're unfamiliar with the Foundation Framework, see the Foundation Framework Reference.

When you create a dictionary, you're also creating an instance of a Foundation class, namely NSMutableDictionary. The attributes you define for the class are keys to the dictionary.

Enterprise object classes are created when you add a display group to your application. See "Creating a WODisplayGroup."


Table of Contents Next Section