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
StrictMethod naming
StrictLocal menu naming
RecommendationScript naming
RecommendationCollection 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
  • EDI: Electronic Document Interface
  • FIN: Finance
  • FXD: Fixed Assets
  • GEO: WMS (geode)
  • HRM: HRM
  • MFG: Manufacturing
  • PAY: Payroll
  • POR: RH Portal
  • PUR: Purchase
  • SAL: Sales
  • STO: 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 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:

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.