Subclasses are most useful for offering convenient access to a data subset. For example, consider a class with the model
?TShirt Color UNIQUE Green
Red
Grey
Beige
One possible subclass might consist of all brightly colored
t-shirts. It could be defined in subclasses.wrm as follows:
Class Festive Visible Is_a_subclass_of TShirt Filter "Green OR Red"The next example is used to set aside prolific authors:
Class Prolific_author Visible Is_a_subclass_of Author Filter "COUNT Published > 6"This subclass assumes
?Author Published ?PublicationThis example tests for a particular value in a field:
Class "UK_People" Visible Is_a_subclass_of "Person" Filter "Country = UK"The corresponding model would be
?Person Country TextThe "Visible" attribute makes the subclass appear in the ACEDB main window. "Filter" must be followed by a valid query which results in objects of the appropriate class. Subclasses can be used in queries but you cannot reference them in the models or enter data using them.