Classes

Within object-oriented design, a class is an entity that defines the structure and behavior (i.e., data and code) shared by a set of objects. Each object, therefore, has the structure and behavior defined by its class. The class defines the allowable properties of the objects in that class, as well as the methods that operate on the objects in the class. A class is therefore a template for an object, and an object is an instance of a class.

Categories of classes supported in PSL include the following:

A class definition that serves as a basis for other class definitions. That is, you can create a class (i.e., the subclass) by having it inherit all the methods and properties of any existing class definition (i.e., the superclass). For example, the deposit record class (RecordDEP) and loan record class (RecordLN) inherit their attributes from the account superclass (RecordACN).

A class can only have one immediate superclass.

A class that inherits all the properties of any existing class definition (i.e., the superclass). For example, the deposit record class (RecordDEP) and loan record class (RecordLN) inherit their attributes from the account superclass (RecordACN). You can then add properties and methods as needed to the new class, as well as modify attributes and methods inherited from the superclass. The subclass, therefore, contains all the attributes of the superclass plus any that you add to it.

A class can have any number of subclasses. A subclass can, in turn, be a superclass of another subclass.

A class that you cannot designate as a superclass. The properties and methods of a final class cannot be inherited by other classes. For example, if you define the XYZ class as final, you cannot create subclasses based on (i.e., inherited from) the XYZ class.

image\msgs.gif

The concept of Final Classes is not available in this PSL release.

A superclass that declares the structure of a class without providing a complete implementation of every method. You may want to define a superclass that only defines a generic form that is shared by all its subclasses, yet enabling each subclass to specify the details. For example, the PSL Record class contains all the methods used by its subclasses RecordACN, RecordDEP, RecordLN, RecordCRCD, etc. You cannot create an instance of the Record class because it has no meaning. However the Record class does contain the methods of all its subclasses.

For a list of PSL classes, refer to the PSL Classes section.

image\msgs.gif

PSL does not currently support the concept of Packages (i.e., a feature used to group similar classes).