How to naming

This document defines the naming conventions to use when performing standard or specific development tasks to avoid naming conflicts. Some of the rules stated below are classified as strict recommendations and must be followed rigorously. Others are suggestions that will be validated later.

TypeRecommendations
StrictDictionary naming
StrictClass and Representation naming
StrictMethod naming
StrictLocal menu naming
RecommendationScript naming
RecommendationCollection naming
RecommendationMenu items naming

Strict recommendations

Naming rules for dictionary elements

The code that identifies a dictionary element must follow these naming rules. This includes the following elements:

For these elements, the applicable rules are as follows:

Naming patternUse
A*Supervisor elements.
B* to T*, V*Standard elements.
U*Table starting with U are usually reserved for temporary tables used during updates.
W*Generated elements. Those are only generated by an automatic process; modifying them manually is forbidden.
X*Add-on codes that might be developed outside of Sage.
Y*, Z*Specific elements developed outside of Sage.
QLFarea_caseTest cases for automated tests. It is good practice to group the unit tests of the same area by having a common prefix. The naming rules are:
  • A* : Reserved for supervisor
    • AR : Runtime
  • CDA: Common Data
  • CDT: Continuous Delivery and Testing
  • CRM: Customer Relationship Management
  • EDI: Electronic Document Interface
  • FIN: Finance
  • FXD: Fixed Assets
  • GEO: WMS (geode)
  • HRM: HRM
  • MFG: Manufacturing
  • PAY: Payroll
  • PJM: Project Management
  • POR: RH Portal
  • PUR: Purchase
  • SAL: Sales
  • STK: Stock
  • W* : Generated test scripts
  • X* : Add-ons
  • Y* : Assets (vertical or specific development)
  • Z* : Assets (vertical or specific development)
For example, `QLFAS_*.src` is the pattern for supervisor unit tests.

Note: By default, when using the meta data generation tool, the collection is called according to the pattern L* (previously C*). It is not recommended to keep this style of collection name because it is difficult, and therefore, makes the code less readable. It is recommended to rename a collection by giving it a clear and explicit name that does not conflict with other properties.

Naming rules for classes and representations

These rules are in addition to Naming rules for dictionary elements. They are applicable for standard development.

Persistent classes

The main class that manages a table must have the exact same name as the table itself.

The cache class of a table must be named with the table abbreviation.

The desktop representation of a class must be named with the class name.

The mobile representation of a class must be named with the class name + the 'M' letter.

The tablet representation of a class must be named with the class name + the 'T' letter.

If an additional representation is added to the class, it must be named with the table name + a suffix that identifies its purpose.

ObjectName
TableMYTABLE
Main classMYTABLE
Cache classMYT
Main desktop representationMYTABLE
Main mobile representationMYTABLEM
Main tablet representationMYTABLET
Additional representationMYTABLEAD1

If a variant class is added to the table, it must be named with the table name + a suffix that identifies the variant.

ObjectName
TableMYTABLE
Main classMYTABLEVAR
Main desktop representationMYTABLEVAR
Main mobile representationMYTABLEVARM
Main tablet representationMYTABLEVART
Additional representationMYTABLEVARAD1

Other classes

Classes that are not linked to a table must be named with a name that is different from an existing table name or table abbreviation. This means the class name cannot be one that already exists in the dictionary table.

Naming rules for methods

It is important to distinguish between public methods that can be used by any developer using a class delivered in the standard, and private methods that are defined for internal use of the class implementation.

The private methods need to be prefixed by an underscore followed by a character that corresponds to the naming rule previously defined. For example:

The private methods are not documented and are subject to change without notice. To avoid their use by developers that don't follow the rules, it is recommended to implement the corresponding code in a separate script that is not supplied in the source.

Numbering rules for elements identified by a number (local menus, miscellaneous tables...)

MISCELLANEOUS TABLES
RangeUse
1000-1999Vertical developments
4000-4999Addons
6000-6999Specific developments
8000-8999Localizations
13000-13999Addons
18000-29999Addons
LOCAL MENUS
RangeUse
160-164Messages for specific developments
165-169Messages for vertical developments
1000-1999Local menus for vertical developments
4000-4999Addons
5100-5199Messages for vertical developments
5100-5199Local menus for vertical developments
5200-5999Local menus for vertical developments
6000-6199Messages for specific developments
6200-6999Local menus for specific developments
8000-8999Localizations
13000-13999Addons
18000-29999Addons

Other recommendations

Scripts organization

There is no strict recommendation about the script organization except for the following rules:

Library script

A script storing a library of functions must follow the naming rules previously defined (prefix).

When functions are written for native version 7 functions, it is strongly recommended to write them in scripts that don't contain version 6 code. This will help in the future to deprecate the version 6 code.

We need to distinguish the scripts containing version 7 native code from the scripts containing version 6 code. We considered a recommendation to add _SYRA to the end of the script name, but this might be awkward, and maybe we can find a better recommendation, such as, LIB_ means library, xxxx is an additional significant name. Further discussion is needed.

Example:
If we consider the TRTDEV V6 script that contains miscellaneous scripts related to currency controls
(currency is spelled "devise" in French), the recommendation is to have a name that contains CUR (LIBCUR_SYRA,
or CLIB_CUR, if we consider that C might be the abbreviation of core). Of course, this script will only contain code that is version 7 compliant. 

If there is a subprogram that controls the currency, it would also be nice to rename it from "CONTDEV"
to "CONTCUR."

Normalization of functions called in a library

A good practice is to avoid Subprog when creating functions in libraries, and to use Funprog instead to simplify error handling. In a case where this is not relevant, we don't have an error class that would handle the error in a simple way. So then the normalization is:

Scripts associated with classes

A script associated with a class is by default created with a name in 4 segments with an underscore between the second and third segments. This creates a name in the AB_CD format, where:

For example, a vertical developer using the prefix XVE for all his dictionary elements has a vertical script associated to the standard class BPCUSTOMER. The recommended script name would be:

Splitting scripts

Because a script associated with a class could be huge for complex objects, or for a better code organization, it's useful to split this script into several subscripts.

Following the previous chapter the name will have 5 segments, what changes is the end of the name AB_CD_E

For example, the main script BPCUSTOMER_CSTD will call subscripts as follow:

Caution: those subscripts have not to be defined as class scripts in the class dictionnary, they are called from the main one which act as a router.

BPCUSTOMER_CSTD_TYP and BPCUSTOMER_CSTD_GAT are not called from BPCUSTOMER_CSTD. BPCUSTOMER_CSTD_TYP will be linked to the data type in the data type dictionnary, and BPCUSTOMER_CSTD_GAT will be called by the remote call API.

Example of what could be the BPCUSTOMER_CSTD routing:

$EVENT
  Gosub EVENT From BPCUSTOMER_CSTD_EVT
Return

$PROPERTIES
  Gosub PROPERTIES From BPCUSTOMER_CSTD_PRO
Return

$METHODS
  If (left$([L]AMETHOD,1) = "_")
    Gosub METHODS From BPCUSTOMER_CSTD_MPR
  Else
    Gosub METHODS From BPCUSTOMER_CSTD_MPU
  Endif
Return

$OPERATIONS
  If (left$([L]AOPERATION,1) = "_")
    Gosub OPERATIONS From BPCUSTOMER_CSTD_MPR
  Else
    Gosub OPERATIONS From BPCUSTOMER_CSTD_MPU
  Endif
Return

Collection names

A collection is a property like any other. Using prefixes like C_ is strongly not recommended, for several reasons:

This doesn't mean that naming frequent collections is not valuable. For example, having a standard short name for addresses, or cost accounting segments can be a good idea. A simple name such as IADD (invoice addresses), OADD (order addresses), or CCE (cost accounting) can be clear enough.

Naming rules for menu items

The menu items associated to classic pages have to follow the rule given by the menu profile naming tool. The other menu items follow the naming rules we already have for the other dictionary elements, described here.