Where to declare?
The first question to answer about a pool or variable is: To which application namespace should it belong?
Unlike unmanaged pools and global variables, which are visible from anywhere, pools and application variables declared in an application namespace have restricted visibility. A pool or application variable declared in an application namespace is visible within the application and its subapplications. In some situations, these bindings are not visible within a method if they are masked by one of the following with the same name:
Class variable
Pool variable
Instance variable
Argument
Temporary variable
Pools and application variables declared as public in an application namespace are also visible in dependent applications and their subapplications; names declared as private are not visible in other applications.
The simplest case occurs when a pool or application variable is used within only one application and its subapplications. In this case, the declaration should be added to the application. If the declaration is flagged as private, other applications cannot reference the pool or application variable. If it is flagged as public, dependent applications can reference the pool or application variable.
It is common for a pool or application variable to be referenced from several applications. In this case, a public declaration must be in an application that is a common prerequisite of all the applications that need it. (This is the same restriction that has always applied to class visibility.) If there is no common prerequisite for all the applications, it may be necessary to create a declarations-only application to be the common prerequisite.
Last modified date: 01/29/2015