Creating Application Packages

This section provides an overview of package names and discusses how to create application package definitions.

You can create a subpackage with the same name as another package or subpackage within the same application package definition, as long as the fully qualified name is unique for each subpackage. Each subpackage is differentiated by the full path name of the class (from the package definition name and the subpackage name).

Image: Example of application package naming conventions

The following is an example of application package naming conventions, which shows a case where in, suppose in the application class PT_FRUIT, where PT_FRUIT is the primary class, you had the following structure of subpackages (no classes are listed in this example):

Example of application package naming conventions

In this example, three subpackages are named Raw, but the fully qualified name for each is unique. For example, the first one is qualified by the name of the primary package. Its fully qualified name is PT_FRUIT:Raw.

The other Raw subpackages are also qualified by the subpackages that contain them. Their names are PT_FRUIT:Reciepies:Raw and PT_FRUIT:Smoothies.Raw.

Similarly, you cannot create two classes with the same name within a given package or subpackage. You can create classes with the same name within the same application package definition, just like subpackages, as long as the fully qualified name is unique. Each class is differentiated by the full path name of the class.

Note: You cannot create a structure for which more than two levels of subpackages are defined below the primary package.

This section discusses how to create a new application package or insert a new package or class into an application package.

To create a new application package, access Application Designer and select File, New, Application Package.

To insert a new package or class, open an application package definition. Select a package or subpackage and select Insert, Package or Insert, Application Class.

Application package names and application class names must begin with an alphabetic character and must consist of only alphanumeric characters and underscores ( _ ).

Note: In certain cases you may encounter an error if you use Save As to create a new application package.

The error occurs when you choose to save the PeopleCode with the application package and the PeopleCode uses a %This system variable. The %This system variable is used in application class PeopleCode to refer to the current object.