Declaration of Application Classes

This section provides instructions for declaring application classes.

Application object references are declared in your PeopleCode programs by either the short name of the class (if the short name is unambiguous amongst all the imported classes), or by the full name of the class. Like all uses of class names, to use the name in a variable declaration, you must have imported the class. Application objects can be of Local, Global, or Component scope.

Every application class is a definition of a new data type in PeopleCode, like the record, rowset, or field data types. The application class includes both the definition of its external interface, its data (properties and instance variables), and its actions (methods), just like the PeopleSoft delivered classes.

When you import a class name, fully-qualifying it is optional. The syntax is:

<package>:<subpackage>:<...>:<classname or wildcard>

PeopleSoft recommends that you individually import each class when you import multiple classes from the same package, instead of using wildcards.

PeopleSoft recommends that you do not set %Super to a new instance of the current class you are defining because this would start an infinite loop.

/* Do not do this! */
%Super = %This;

PeopleSoft recommends that you use private methods for succinct operations, even if they aren’t reused, to improve the readability and maintainability of the code. You can also do this by using many inline comments.