Naming Conventions Best Practices
It is recommended to standardize your naming format. It makes the code readable and understandable. This is very helpful when more than one developer is involved. Use the following conventions:
-
Upper CamelCase comprises several words joined together without spaces, with the initial letter in uppercase and the first letters of subsequent words in uppercase, for example, LastName.
-
Lower CamelCase comprises several words joined together without spaces, with the initial letter in lowercase and the first letters of subsequent words in uppercase, for example, readData.
Functions/Methods
Object |
Convention |
Examples |
---|---|---|
Function/method |
Lower CamelCase |
read() readCustomerData() |
Type |
Upper CamelCase |
SubAccount
|
Property |
Upper CamelCase |
Address ZipCode |
Local Variable used inside a Function |
Lower CamelCase |
Declare output of Text
Declare configKey of Number |
Parameters |
Lower CamelCase |
pSubAccount |
Testing functions |
Begin with zz |
zzreadData() |
In addition, if your solution requires additional functions, you can develop additional Library functions in Visual Studio. See the APA Library Functions SDK.
Other Entities
Rules, Event Handlers, Callouts, Launch In Context, Data Collection, and Database Commands.
Object |
Convention |
Examples |
---|---|---|
Rules Event Handlers Callouts Launch In Context Data Collection |
Upper CamelCase |
ShowTestCallout CloseClicked ReadLedgerData TestCallout |
Database Commands |
Lower CamelCase (after any prefix) |
|
Local Commands |
Begin with lcl_ |
lcl_getInteraction |
Server Commands |
Begin with svr_ |
svr_getInteraction |
Testing entities |
Begin with zz |
zzShowCallout zzAccountData |
Screen Elements
Object |
Convention |
Examples |
---|---|---|
Visible Screen Elements |
Upper CamelCase |
Meaningful names, for example: FirstName LastName CreditCardField CCField |
Non-Visible Screen Elements |
No need to modify. |
|
Father branch |
Upper CamelCase |
Meaningful names (in Web connectors this is the HTML document), for example: OrderPage ConfirmationPage |
Workflow
Object |
Convention |
Examples |
---|---|---|
Steps |
Upper CamelCase |
Begin with an increasing unique number, for example: 01 MyFirstStep 02 MySecondStep |
Graphics – Steps |
Use legend per step type (decision/action/ callout) |
|
Graphics – Transitions |
Loop transition: {Width=3,Color [Red]} |
|
|
Go back transition: {Width=3,Color [Green]} |
|
|
AT(Always true): {Width=3,Color[GreenYellow]} |
|
|
Event transition: {Width=3,Color [Gold]} |
|
Transition |
Locate the label close to the transition. |
|
|
When using a generic name, add the step name. |
For example, for a step named 01 MyFirstStep, use a generic transition name such as 01 Retry or 01 True. |
Commenting
-
Add comments anywhere where multiple actions are executed in the business logic to break down and describe the steps. These can be added in workflow steps, event handlers, rules, and functions.
-
Enter a Description on the Info tab of all objects, describing the overall purpose of the object.