Apertus Naming Conventions for OpenROAD

This document is an adapted version of the naming conventions standards used at Apertus Systems. The conventions are intended to be used as an integrated and consistent system, and aim to enhance clarity and prevent confusion. The conventions cover all components required for OpenROAD development up to version 4.0, but also address conventions for naming databases and their components.

This version represents only the relevant portion of the naming conventions used at Apertus, but still retains consistency. These conventions have been used successfully at Apertus on a number of projects and are provided here for the use of the OpenROAD development community. Use and adapt them freely for your own purposes, but please accept that Apertus cannot accept responsibility for errors in or omissions from the conventions.

For more details on Apertus and our Ingres development services, please contact Mike Weightman at:

Apertus Systems Limited
Technico House
Richardshaw Lane
Leeds
LS28 6AA
UK.
Phone: (44) 113 256 6000
Email: enquiries@apertus.uk.com

 

Contents

1 System Name and Identifier

2 Database Names

2.1 Database Names

2.2 User Table Names

2.3 Work or Temporary Tables

2.4 Column Names

2.4.1 Columns Names: Synonyms

2.4.2 Column Names: Homonyms

2.5 View Names

2.6 Secondary Index Names

2.7 Database Rule Names

2.8Database Procedure Names

2.9.Database Event Names

3 OpenROAD Naming Conventions

3.1 OpenROAD Application Naming

3.2 Frame and Global Procedure Naming

3.3 Include Script Naming

3.4 Local Procedure Naming

3.5 User Class Naming

3.6 Naming Objects Based on User Classes

3.7 Variables Using Simple Data Types

3.8 Global Constants and Variables: Simple Datatypes

3.9 Naming Objects Based on System Classes

3.10 Prefixes for Common System Classes

3.11 User Class Attributes

3.12 User Class Methods

3.13 Variables Defined in Local Procedures, Userclass Methods, Event Blocks, etc

3.14Parameters to Procedures and Methods

3.15 Combinations

A Appendix OpenROAD System Class Prefixes

 

 

1. System Name and Identifier

System names are largely determined by the customer: consider recommending that the word 'system' should not necessarily be included in the system name.

Once the system has a name a two letter system identifier should be assigned, which is used as a prefix to identify databases, database components and programs created specifically for the system. The two letter identifier should be unique to the installation.

Also create one or more sub-system names and associated two letter identifiers. Each two-letter sub-system identifier should be unique within the system. If you anticipate that your application will need to share application specific global procedures between sub-systems, create a sub-system with the identifier 'gp'. This sub-system should be used for global procedures only.

For example, system Transport Management has identifier tm, with sub-systems Data Maintenance dm and Security Maintenance sm. The combination of the system and sub-system identifier, e.g. tmdm then serves as a prefix for application objects within that sub-system. Refer to the sections below for full details of the naming conventions for different sourcecode types within the sub-system.

Back to Contents

 

2. Database Names

2.1 Database Names

Ingres database names are formed by concatenating the following, separated by underscores:

The status identifiers to be used are as follows; not all these database types need necessarily be used on every project.

Status identifier

Database type

p<inits>

dev

sys

uat

int

mas

prod

Personal database

Development and unit test database

System test database

User acceptance test database

Integration test database

Master database (used as repository for live code)

Live or production database

Examples:

nc_tm_devdb - Northern Carrier Transport Management development and unit test database

Ingres stores database names in lower case. Upper case names should not be used, although Ingres converts these to lower case.

The DBA owns all but the personal databases which are owned by the developer (created as a private database).

 Back to Contents

 

2.2 User Table Names

Database table names will be in the singular, not the plural, and will be based on the logical entity name. The table name should not exceed 20 characters in length. This will allow any secondary indexes and rules for the table to use the same name with identifying suffix characters.

Where tables relating to two or more separate systems reside in the same database, consider prefixing the table name the two letter system identifier.

Back to Contents

 

2.3 Work or Temporary Tables

Work or temporary table names are prefixed by the seven characters uniquely identifying the application component (i.e. the four letter system and sub-system code and three digit component identifier), followed by a unique number.

Work or temporary tables are defined as tables created and subsequently dropped by the application, or tables which reside permananently in the database but which are only populated in a transient fashion by the application and thus have no value in business terms.

Back to Contents

 

2.4 Column Names

Column names are based on the logical attribute name from the Logical Data Model. Names are 24 characters or less in length and include underscore characters to improve readability.

Abbreviated words should be used in column names only where this is required in order to fit the full name within the maximum length. The same abbreviation for a given word should be used throughout the database where that word needs to be abbreviated; this does not however necessarily imply that every occurence of a given word must be abbreviated simply because it is abbreviated in some instances. Abbreviated and non-abbreviated words may be mixed within the same column name if required.

Where abbreviated words are used, they should be formed using the following conventions:

Examples:

alwnc - 'allowance'

pnc - 'pence'

cnsmr - 'consumer'

cnsmptn - 'consumption'

trf - 'tariff'

 

Exceptions to the above conventions are as follows:

The column name must contain an indication of the domain as a suffix. Where the domain is unambiguous, e.g. postcode, this can be omitted. Generic suffixes are:

Prefix

Explanation

Notes

_dt

Date

-

_tm

Time

-

_dtm

Date and time

-

_no

Number

Meaningful in business terms

_cd

Code

Meaningful in business terms

_ref

Reference

Meaningful in business terms

_id

Identifier

Meaningful only to the system

_f

Boolean indicator or flag

Always has two allowable values

_ind

Multi-valued indicator

-

_stat

Multi-valued status identifier

-

_desc

Description

-

_txt

Text

-

_qty

Quantity or amount

-

_cnt

Count

-

_nm

Name or title

-

 

Examples:

tax_percentage

Percentage rate at which tax is applied

current_margin

Current margin charged

trf_expiry_dt

Expiry date for a tariff

authorisor_id

Internal code identifying authorising person

trf_desc

Description of a tariff

trf_energy_cd

Meaningful code denoting an energy type for a tariff

retrospective_f

Flag indicating whether or not a discount is retrospective

user_security_ind

Multi-valued indicator holding security level

supplier_nm

Name of a supplier

cost_note_txt

Text notes about costing

Back to Contents

 

2.4.1 Columns Names: Synonyms

Columns which have the same definition and identical meanings should have the same name.

For example, financial_year on one table should not be called financial_yr or accounting_year on another table (or system).

Back to Contents

 

2.4.2 Column Names: Homonyms

Columns which do not have the same definition and do not have identical meanings should NOT have the same name.

For example, a column called cleared_by on one table might be used to hold the date on which an order was cleared. On another table we might wish to hold the name of the person responsible for clearing the order. The column on this second table must NOT be called cleared_by because the meaning and probably the definition is different in each case.

Homonyms can be accidentally created when the context of an attribute changes due to it being included as a column on another table. To avoid this, ensure that a column name's meaning is also clear outside the context of the table. For example, avoid column names such as description or total.

Back to Contents

 

2.5 View Names

Views are given a meaningful name using underscores for readability, and suffixed by '_vw'.

Example:

cmpttr_trf_vw - View of competitors' tariffs

Back to Contents

 

2.6 Secondary Index Names

Secondary index names consist of the table name that the index is used for, suffixed by '_i<nn>' where <nn> is the index number, starting at 01, for that table.

Examples:

trf_version_i01 - The first index on table trf_version

trf_dscnt_i03 - The third index on table trf_dscnt

Back to Contents

 

2.7 Database Rule Names

Database rule names are given a meaningful name (normally the table name), suffixed by '_<x>rul', where the character 'x' is u, i, d or c indicating an update, insert, delete or combination.

Example:

unit_charge_urul - Rule that triggers on update of table unit_charge

Back to Contents

 

2.8 Database Procedure Names

Database procedure names are given a meaningful name using underscrores for readability, suffixed by '_pr'.

Example:

calc_unit_charge_pr - Database procedure calculating unit charges

Back to Contents

 

2.9 Database Event Names

Database events are given a meaningful name using underscrores for readability, suffixed by '_ev'.

Example:

print_request_ev - Database event signifying a print request.

Back to Contents

 

3. OpenROAD Naming Conventions

3.1 OpenROAD Application Naming

OpenROAD application names consist of the two-letter system identifier code followed by a short, meaningful description of the application using underscores for readability. (The two-letter sub-system identifier is not used in the application prefix as it is common in OpenROAD applications to place application components for several sub-systems within a single physical application.)

Example:

TM_Business_Objects - application containing the business objects for the Transport Management system

Back to Contents

 

3.2 Frame and Global Procedure Naming

Frame and global procedure names are derived by concatenating the following:

Examples:

tmdm0130_TaxDetail - frame in Transport Management used to maintain tax details;

tmgp0090_LoadStaticLists - global procedure used by all Transport Management sub-systems to load static lists

 

The 4-digit identifiers used should follow in sequence where the components are related. Use steps of ten between component groups.

Examples:

tmdm0130_TaxDetail - detail frame for tax details (this component group starts at 0130)

tmdm0134_TaxList - list frame for tax details

tmdm0138_TaxSearch - search frame for tax details

tmdm0140_TimebandDetail - detail frame for timeband details

 

Note that no identifier is used in the name to distinguish between frames and global procedures within a sub-system as this information is readily available from the Component Catalog.

Back to Contents

 

3.3 Include Script Naming

As with frame and procedure names, include script names must be unique within eight characters. The names are derived by concatenating the following:

Include script 4-digit identifiers should follow on directly from the number used for the frame or global procedure which uses them.

Examples:

tmdm1101_is_PostOk - First Include script for tmdm1100_TransportDetail

tmdm1102_is_PreNewDisplay - Second include script for tmdm1100_TransportDetail

 

Back to Contents

 

3.4 Local Procedure Naming

Local procedures in OpenROAD are defined as procedures which are private to a given frame or global procedure. Local procedure names consist of two or more words describing the function the procedure performs; the name is written in mixed case without underscores.

Example:

ValidateCharges - local procedure which validates tariff charge data

 

Note that to avoid confusion, different naming conventions exist for local and global procedures.

Back to Contents

 

3.5 User Class Naming

User class names are formed by concatenating the following:

Possible user class type suffixes are as follows. Note that the suffixes use the generic object orientation term 'business class'.

Suffix

Meaning

_bc

Indicates a normal business class containing attributes and methods.

_list_bc

Indicates a list of instances of the business class, or 'list class'.

_searchcrit_bc

Indicates a set of search criteria used to populate a list class.

_gcn

Indicates a GUI class used to display information not required in a business class itself, where n is the sequential number of the GUI class starting at 1.

_bs

Indicates a business structure (i.e. a class which has meaning only when used in conjunction with another class, and which may have attributes only).

_gsn

Indicates a GUI class used to display information not required in a business structure itself, where n is the sequential number of the GUI class starting at 1.

_fc

Indicates a function class (i.e. a class used to hold data and functionality relating to a function).

_fs

Indicates a function structure (i.e. a class which has meaning only when used in conjunction with a function class, and which may have attributes only). This is rarely necessary.

Examples:

uc_timeband_bc - Business class used to hold details of timebands

uc_timeband_list_bc - List class holding a list of instances of uc_timeband_bc

uc_timeband_searchcrit_bc - Search criteria to populate uc_timeband_list_bc

uc_timeband_gc1 - GUI class number 1 for additional display items for uc_timeband_bc

uc_timeband_gc2 - GUI class number 2 for additional display items for uc_timeband_bc

uc_timeband_coverage_bs - Business structure used to validate timeband coverage

uc_timeband_coverage_gs1 - GUI class number 1 for additional display items for uc_timeband_coverage_bs

uc_app_func_detail_fs - Function structure holding the details of a given application function as used by the application function class list uc_app_func_list_fc

 

Back to Contents

 

3.6 Naming Objects Based on User Classes

The following conventions are used to indicate frame or procedure variables whose datatype is a user class:

Convention

Description

UCucx

Used for a variable of user class type ucx. If necessary, the name of the user class should be suitably abbreviated in the variable name. Note there is no underscore between the UC and the user class ucx.

DUCucx

As above, but this indicates a dynamically created variable of user class ucx.

arr_ucx

Indicates an array of type user class ucx.

 

Examples:

UCSupplier - variable of type uc_supplier_bc

UCSupplier_tmp - variable of type uc_supplier_bc

UCSupplierList - variable of type uc_supplier_list_bc

UCSupplierSearchCrit - variable of type uc_supplier_searchcrit_bc

DUCSupplier - dynamically created variable of type uc_supplier_bc

arr_UCSupplier - array of type uc_supplier_bc

 

Where system class composites are used to display objects based on a user class, the appropriate composite field prefix can be placed before the object field name. Note that this prefix must not be used when the field is nested within a class-mapped composite. See section 6.10 for a list of common system class prefixes.

 

Examples:

mtx_UCSupplier - matrix field used to display uc_supplier_bc

stk_UCSupplier - stack field used to display uc_supplier_bc

 

Back to Contents

 

3.7 Variables Using Simple Data Types

Variables of simple data types used in frames, global procedures and userclass methods are not prefixed with a scope indicator. These variables are formed by concatenating the following:

The following prefixes are used to indicate simple datatypes:

Prefix

Description

c_

Indicates a char variable.

d_

Indicates a date variable.

f_

Indicates a float variable (4 or 8 bytes)

i_

Indicates an integer variable (4 bytes)

s_

Indicates a smallint variable (2 bytes)

v_

Indicates a varchar variable.

 

Examples:

i_ retval - variable of type integer used for return code

d_effective_from - variable of type date used for an effective date

v_trf_desc - variable of type varchar used for a tariff description.

 

When using 'well known' variable names, such as i and j (usually used as loop counters), the type can be omitted. Such variables should have a short life, i.e. the value should have meaning within a very limited context of the program only. It must be stressed that this exception is for a small number of variables only.

Back to Contents

 

3.8 Global Constants and Variables: Simple Datatypes

Global constants and variables have the scope of an entire application, i.e. all frames, user class methods and global procedures. The most commonly used globals use the simple datatypes listed in the previous section; however, they may also use the special datatypes as explained in a later section. Global constants and variables with simple datatypes are formed by concatenating the following separated by underscores, written in upper case:

Examples:

GC_I_ST_INITIAL - global constant of datatype integer, within domain 'state', meaning 'initial'

GV_V_FQ_DAILY_TXT - global variable of datatype varchar, within domain 'frequency', meaning 'text string for daily'.

 

Back to Contents

 

3.9 Naming Objects Based on System Classes

All system classes allow you to create objects as a reference variable based on the class in a script. Some system classes (e.g. ButtonField, StackField) also allow you to create objects on a form on based on the system class.

As confusion may arise for the classes which allow you to create objects in both ways, two naming conventions are used for system class objects in order to allow you to distinguish between the objects created in the two ways.

The first of these two naming conventions is used for:

These objects are named by concatenating the following separated by underscores, written in lower case:

Examples:

btn_ok - button field on the form meaning 'OK'

tgl_energy_type - toggle field on the form meaning energy type

cl_trf_category - reference variable of type ChoiceList used for a list of valid tariff categories

fe_energy_type_popup - reference variable of type FrameExec used to hold a pointer to a popup frame allowing the user to choose an energy type.

The second of these two naming conventions is more rarely required; it is used for:

These objects are named by concatenating the following separated by underscores, written in lower case:

Examples:

rtgl_gmt_ind - reference variable of type toggle field holding a GMT indicator

rbtn_display_type - reference variable of type button field holding a display type indicator.

 

Back to Contents

 

3.10 Prefixes for Common System Classes

Commonly used system classes are shown below with their prefixes. A full list of system class prefixes is given in Appendix A. The table also shows whether each class allows you to create objects on a form.

System Class

Prefix

Definable as field on a form?

[N/A: special case]

arr

No

BitmapObject

bo

No

ButtonField

btn

Yes

ChoiceItem

ci

No

ChoiceList

cl

No

EnumField

enf

No

FieldObject

fo

No

FrameExec

fe

No

FreeTrim

trm

Yes

ImageTrim

imgt

Yes

IntegerObject

io

No

MatrixField

mtx

Yes

MenuBar

mnu

Yes

MenuButton

btn

Yes

MenuList

lst

Yes

MenuToggle

tgl

Yes

StackField

stk

Yes

StringObject

so

No

TableField

tf

Yes

ToggleField

tgl

Yes

 

Some further very common system classes may be used to create fields on forms, different instances of which may be defined as being of different datatypes. Therefore, these system class prefixes also include a datatype indicator after the class prefix itself. The system classes to which this applies are as follows:

System Class

Prefix

Definable as field on a form?

EntryField (singleline)

sefx

Yes

EntryField (multiline)

mefx

Yes

ListField

lstx

Yes

OptionField

optx

Yes

RadioField

rdox

Yes

 

The x indicates a datatype indicator is one of the list shown in section 6.7. All this is illustrated below.

Examples:

sefi_trf_cd - Singleline entry field of type integer holding a tariff code

sefv_category_nm - Singleline entry field of type varchar holding category name text

mefv_trf_desc - Multiline entry field of type varchar holding a tariff description

rdoi_payment_type_cd - Radio field of type integer holding a payment type code

lsti_timeband_cd - List field of type integer containing a timeband code

opti_supplier_cd - Option field of type integer containinga supplier code

 

Remember that as stated in section 6.6, if any other system class variable, eg. a table field, is assigned a data type of a user class, then the data type should be included in the variable declaration.

Examples:

tf_UCsltlst_tmp - a TableField with a type of user class uc_sltst_bc

arr_UCsltlst_tmp - array with a type of user class uc_sltst_bc

 

Back to Contents

 

3.11 User Class Attributes

User class attributes names reflect their data type, which may be a simple data type, a system class or a user class. Thus, user class attributes are named according to the conventions used for naming variables of simple data types (see section 6.7), for naming objects based on system classes (see section 6.9) or for naming objects based on user classes (see section 6.6). (When naming attributes based on system classes, the 'r' prefix as described in section 6.9 is unnecessary.)

Where an attribute holds data from a given database table column, the attribute should have the same name as the column, prefixed by the relevant data simple type (as no char data type exists for attributes, char columns are held as varchar attributes; similarly, only smallint and integer are supported, so integer1 and integer2 columns are held in smallint attributes, and integer4 columns in integer attributes).

Examples:

i_trf_category_id - Attribute of type integer holding column trf_category_id

v_amendment_desc - Attribute of type varchar holding column amendment_desc

i_has_trf_notes_changed - Attribute of type integer containing an internal flag

s_competitor_no - Attribute of type smallint holding a competitor number

UCTariffDiscountDetails - Attribute of type uc_tariff_discount_bc

arr_UCTrfStatusHistory - Array attribute of type uc_trf_status_history_bc

bo_gas - Attribute of type BitMapObject holding a gas image.

 

Back to Contents

 

3.12 User Class Methods

User class methods are given meaningful names and written in mixed case without underscores. Where a method accesses the database the name is prefixed by 'DB'.

Examples:

CheckFullNameUnique - Method to validate a name item

DBFullyPopulate - Method to access the database to fully populate an object.

 

Back to Contents

 

3.13 Variables Defined in Local Procedures, Userclass Methods, Event Blocks, etc

A local variable is a variable whose scope or visibility is one of the following:

The local scope of the variable (as opposed to variables global to a frame or global procedure) is shown by a prefix. Local variables are formed by concatenating the following separated by underscores:

Examples:

l_i_cum_charge - Local variable of type integer holding a cumulative charge

l_v_category_sav - Local variable of type integer holding a saved category

 

Back to Contents

 

3.14 Parameters to Procedures and Methods

When a variable is being used as a parameter is passed to a local procedure or to a method, this is indicated by a prefix. Parameter variables are formed by concatenating the following, separated by underscores:

Examples:

p_c_trf_category - parameter variable of type char indicating tariff category, passed by value

b_i_tot_charge - parameter variable of type integer holding a total charge, passed by reference.

p_fe_tariff_popup - parameter variable of type FrameExec holding a pointer to a popup frame, passed by value

b_arr_UCSupplier - parameter variable of type array of uc_supplier_bc, passed BYREF.

 

Back to Contents

 

3.15 Combinations

Prefixes can be combined using the formats specified in sections 6.6 to 6.14 in conjunction with the following rules:

Examples of combined prefixes are shown below.

Prefix

Meaning

b_arr_

Indicates an array passed by reference to the frame/global procedure.

b_f_

Declares a floating point variable, sent by reference from another procedure.

b_i_

As above but using an integer.

rsefi_

Indicates a script declared EntryField reference variable, containing an integer

p_sefv_

Indicates a script declared EntryField containing a varchar, passed from another frame/procedure (the 'r' prefix is implied)

GV_I_

This declares a global integer variable.

GV_tgl_

Indicates that this is a global ToggleField variable.

GV_UCcls_

This global variable is a user class (of class 'cls').

p_arr_

Indicates that the variable is an array passed from a frame/procedure.

p_arr_UCcls_

This indicates that the parameter from another frame/procedure is an array of user class 'cls'.

p_UCcls_

This indicates that the variable is a user class instance (of class 'cls') from another frame.

Back to Contents

 

A. Appendix OpenROAD System Class Prefixes

The following list shows each System Class with its prefix which should be used for fields declared on the form. An 'r' should be added to this prefix to indicate a reference variable declared in the script for classes which are also definable as a field on a form.

 

System Class

Prefix

Definable as field on a form?

ActiveField

af

No

AnalogField

anf

No

AppFlag

apf

No

AppSource

aps

No

ArrayObject

ao

No

AttributeObject

ato

No

BarField

barf

Yes

BitmapObject

bo

No

BoxTrim

btrm

Yes

BreakSpec

bs

No

ButtonField

btn

Yes

ButtonField on Toolbar

btn_tb

Yes

ButtonPopup

btnp

Yes

CellAttribute

ca

No

ChoiceBitmap

cb

No

ChoiceField

cf

No

ChoiceItem

ci

No

ChoiceList

cl

No

Class

cls

No

ClassSource

cs

No

ColumnCross

cc

No

ColumnField

clf

No

CompositeField

cpf

No

CompSource

cps

No

ControlButton

ctb

No

CrossTable

ct

No

CursorObject

co

No

DataStream

ds

No

DateObject

dto

No

DBEventObject

dbo

No

DbSessionObject

dso

No

DisplayForm

df

No

DynExpr

de

No

EllipseShape

elps

Yes

EntryField (Singleline)

sef

Yes

EntryField (Multiline)

mef

Yes

EnumField

enf

No

Event

ev

No

External Class

ec

No

External Object

eo

No

FieldObject

fo

No

FlexibleForm

flf

Yes

FloatObject

flo

No

FormField

ff

No

FrameExec

fe

No

FrameForm

frf

No

FrameSource

fs

No

FreeTrim

trm

Yes

GhostExec

ge

No

GhostSource

gs

No

ImageField

img

Yes

ImageTrim

imgt

Yes

IntegerObject

io

No

ListField

lst

Yes

ListViewField

lvf

Yes

MatrixField

mtx

Yes

MenuBar

mnu

Yes

MenuButton

btn

Yes

MenuField

mf

Yes

MenuGroup

mg

No

MenuItem

mit

Yes

MenuList

lst

Yes

MenuSeparator

mnus

Yes

MenuStack

mst

No

MenuToggle

tgl

Yes

MethodExec

mte

No

MethodObject

mto

No

MoneyObject

mo

No

Object

ob

No

OptionField

opt

Yes

OptionMenu

om

Yes

Proc4GLSource

ps

No

ProcExec

pe

No

ProcHandle

ph

No

QueryCol

qc

No

QueryObject

qo

No

QueryParm

qp

No

QueryTable

qt

No

RadioField

rdo

Yes

RectangleShape

recs

Yes

RowCross

rc

No

ScalarField

sf

No

Scope

sc

No

ScrollBarField

scr

Yes

SegmentShape

segs

Yes

SessionObject

seo

No

ShapeField

shf

No

SliderField

sld

Yes

SQLSelect

sqs

No

StackField

stk

Yes

StringObject

so

No

SubForm

subf

Yes

TabFolder

tab

Yes

TabFolder Button

tabb

Yes

TabFolder Page

tabp

Yes

TableField

tf

Yes

ToggleField

tgl

Yes

TreeViewField

tvf

Yes

UserClassObject

uco

No

UserObject

uo

No

ViewPortField

vpf

Yes

 

Back to Contents