Difference between revisions of "Coding standards"
Jump to navigation
Jump to search
Line 29: | Line 29: | ||
* Shared ressources include "Helper" | * Shared ressources include "Helper" | ||
==== Table naming ==== | ==== DB Table naming ==== | ||
System tables should follow this syntax | System tables should follow this syntax | ||
Line 38: | Line 38: | ||
* data_ | * data_ | ||
* _data_ (deleted tables) | * _data_ (deleted tables) | ||
==== DB Attribute naming ==== | |||
General rules | |||
* Starts uppercase | |||
* Foreign keys ends with ID (uppercase) | |||
Changelog attributes fixed names | |||
* CreatedAt | |||
* CreatedBy | |||
* ModifiedAt | |||
* ModifiedBy | |||
=== Safety standards === | === Safety standards === |
Revision as of 07:09, 24 July 2024
Naming standards
Package / naming placement
- Package name all lowercase
- General platform entities
- Servlets: com.tsnocode.server.servlet
- Filters: com.tsnocode.server.filter
- Core: com.tsnocode.ui
- Fields: com.tsnocode.ui.field.<group>
- Views: com.tsnocode.ui.views.<type> (item,list,statistics,)
- Codeunit: com.tsnocode.codeunit.common
- Solution specific code
- TS customer app:
- com.tsnocode.solution.app
- com.tsnocode.solution.customer
- com.tsnocode.solution.customer.app
- Vendor app:
- com.vendor.tsnocode.app
- com.vendor.solution.app
- TS customer app:
Class naming
Naming convention follows Java standard
- Starting with uppercase
- No special characters
- Seperate words with uppercase
In addition the following are recommended
- CodeunitPage post fix name "Page"
- CodeunitService post fix name "Service"
- Shared ressources include "Helper"
DB Table naming
System tables should follow this syntax
- lowercase
- no special characters
Reserved prefixes include
- data_
- _data_ (deleted tables)
DB Attribute naming
General rules
- Starts uppercase
- Foreign keys ends with ID (uppercase)
Changelog attributes fixed names
- CreatedAt
- CreatedBy
- ModifiedAt
- ModifiedBy
Safety standards
- Input sanitization used in SQL, using either
- Escape all string parameters using DbConnection.EscapeSQL
- Prepared statements
- All Page codeunits should contain some user group restrictions, and set to be default off
Review standards
The following changes requires a formal code review
- Changes to the API
- Changes to common objects
- Command
- Security
- Controller
- DbConnection
- Creation of OR changes to
- Servlets
- CodeunitPagePublic
- Code containing SQL