Naming Conventions
Class Naming Conventions
Class Naming Conventions
| Class Type | Prefix | Notes |
| Code | c |
|
| File | f or F |
|
| Menu | m |
|
| Object | o |
|
| Query* | q |
|
| Remote Task | rt | |
| Report | r | |
| Schema | s |
|
| Table* | t |
|
| Task | none |
|
| Toolbar | T_ | |
| Window | w |
|
*Query class names should match the corresponding table class. E.g. tClient and qClient.
Data Dictionary
Data Dictionary
- All file classes (database tables) used for the Theatre Manager database must be assigned a unique prefix in the Data Dictionary. For example, F_CLIENT uses C_, F_PLAYSEATS uses PS_. There are several essential parts of Theatre Manager that rely on this naming convention for automatic foreign key determination.
- All primary key records are named with the prefix for the file class (database table) followed by SEQ. The primary key for F_CLIENT (C) is C_SEQ.
- All foreign key records require the use of the unique prefix within the name, as well as the suffix _SEQ. For example the F_CLIENT (C) foreign key on the F_PLAYSEATS (PS) record is PS_C_SEQ.
- If the user should not ever see a column, then it should be marked as internal. It is not required to enter a description for internal fields.
Method Naming Conventions
Method Naming Conventions
- Methods are named with camel case beginning with a lower-case letter. E.g. $myMethod
- A method used for a button behavior should begin with $clickBtn. E.g. $clickBtnBuyTicket
- getter methods should start with $get (eg $getCurrentColour)
- setter methods should start with $set (eg $setCurrentColour)
- group similar function methods under a dummy header method with a name that starts with some ---- eg '---- Window Open Methods ----'
Variable Naming Conventions
Variable Naming Conventions
All variables should be named using camel case rather than hyphens or underscores. E.g myVariable or MyVariable instead of MY_VARIABLE.
However, if is a parameter, local, or instance var that is meant to track a cope of a database SEQ key, then call it what it is. eg pM_SEQ means that the parameter we expect is an M_SEQ key. This helps with variable assignment.
All database names will be named using underscores and in UPPER_CASE to make an obvious differentiation between the database and other task/class/instance/local variables.
Scope / Type |
Prefix | Convention |
Task |
t |
|
Class |
c |
|
Instance |
i |
|
Local |
none | Developer preference, prefer myVariable rather than MyVariable. |
Parameter |
p |
|
Constant |
k |
|