G-2130: Try to use subtypes for constructs used often in your code.
Minor
Changeability
Reason
Single point of change when changing the data type.
Your code will be easier to read as the usage of a variable/constant may be derived from its definition.
Examples of possible subtype definitions
Type | Usage |
---|---|
ora_name_type |
Object corresponding to the Oracle Database naming conventions (table, variable, column, package, etc.). |
max_vc2_type |
String variable with maximal VARCHAR2 size. |
array_index_type |
Best fitting data type for array navigation. |
id_type |
Data type used for all primary key (id) columns. |
Example (bad)
1 2 3 4 5 6 7 8 |
|
Example (good)
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|