Skip to main content

Classes

generated description: classexample.gif
Our Caché Cinema application needs to keep track of information about films, such as:

  • The name of the film

  • A description of its plot

  • A count of how many tickets have been sold

  • An indication of whether or not the film is currently playing

In Caché, such a collection of related data elements is called an object and each element is called a property. Our database might contain many Film objects, each of which has the same characteristics but different data. That is, each film has a title, but different films (generally) have different title values.

The definition of an object is called a class and objects are sometimes referred to as instances (or occurrences) of the class that defines them. (Later we'll see that classes can also contain code.)

FeedbackOpens in a new tab