Difference between revisions of "Back-End Standard"

From SmartHCM Wiki
Jump to navigation Jump to search
Line 246: Line 246:
 
| _PK_UK_CK_NN_FK
 
| _PK_UK_CK_NN_FK
 
|SET_LOCATION_LOC_ID_PK, SET_LOCATION_LOC_ID_UK,SET_LOCATION_LOC_ID_CK,SET_LOCATION_LOC_ID_NN,SET_LOCATION_LOC_ID_FK
 
|SET_LOCATION_LOC_ID_PK, SET_LOCATION_LOC_ID_UK,SET_LOCATION_LOC_ID_CK,SET_LOCATION_LOC_ID_NN,SET_LOCATION_LOC_ID_FK
 +
|}
 +
 +
*Example Naming Standard of Database Objects for General use
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Objects
 +
! Suffix
 +
! Abbreviation
 +
! Example
 +
|-
 +
| Package
 +
| _PKG
 +
| ModuleName / MeaningFullName ModuleName_Reports_PKG (For Reports) ModuleName_PKG (For general user for whole module)
 +
| HRS_LEAVE_PKG INV_REPORTS_PKG DFS_COMMON_PKG
 +
|-
 +
| Procedure
 +
| _PRO
 +
| ModuleName / MeaningFullName / Table Name
 +
| INV_ITEM_BALANCE_PRO
 +
|-
 +
| Function
 +
| GET_
 +
| ModuleName / MeaningFullName
 +
| GET_HIJRI_NEXT_MONTH
 +
|-
 +
| Trigger
 +
| TRG_
 +
| ModuleName / MeaningFullName,<_BU> (Before Update) <_BI> (Before Insert) <_BD> (Before Delete) <_BF> (Before insert, update, delete) <_AU> (After Update) <_AI> (After Insert) <_AD> (After Delete) <_AF> (After insert, update, delete) <_IU> (Instead of Update) <_II> (Instead of Insert)<_ID> (Instead of Delete) <_IN> (Instead of insert, update, delete)
 +
| TRG_LOCATION TRG_LOCATION_BF TRG_LOCATION_BI TRG_LOCATION_AU TRG_LOCATION_AI
 +
|-
 +
| Materialized View
 +
| _MV
 +
| ModuleName / MeaningFullName /
 +
| SET_LOCATION_MV
 
|}
 
|}

Revision as of 13:48, 29 April 2015


Naming Conventions and Standards

  • Database Object Name (i.e. Table, Sequence, View, Index, Trigger, Package, Procedure, Function, Materialized View, Job, Type, Directory, Constraints, Synonyms and Tablespace ) should be meaningful. Example : Table Name "HRS_EMPLOYEE_PERSONNEL"
  • Column Name should be clearly defined and meaningful. Example : Employee_ID
  • Database Object name and Column name should not contain the Number and Special characters except "_" character
  • Constraints name should be clearly defined and must be used the prefix and suffix when creating the constraints
Constraints Name
Abbreviation Description Example
fk References (Foreign Key) hr_emp_empid_fk
uk Unique Key hr_emp_empid_uk
pk Primary Key hr_emp_empid_pk
ck Check hr_emp_empid_ck
nn Not Null hr_emp_empid_nn
  • Use the following prefix in Identifier/Variable naming conventions (Local Variable, Global Variable, Parameter Variable, Constant Variable)
Abbreviation Description Example Comment
k Constant k_mailhost Generic constant
g Variable g_loop_count Global (package-level) variable
v Variable v_loop_count Local variable
p Variable p_loop_count Parameter variable
  • Use the following prefix for scalar types that have aggregate data types.
Abbreviation Description Example
c Cursor c_employees
cp Cursor parameter cp_employee_id
r Record r_employee
  • The suffix is used to qualify the identifier further by documenting its usage. For example, the suffix denotes the type of parameter, whether IN, OUT, or IN OUT, or to show that a variable or parameter is also a table.
Type Description Example
Input-only parameter p_num_items
out Output-only parameter p_sum_out
inout Both input and output p_sum_inout

Product Naming Conventions and Standards

  • Use the following prefix in Table, Sequence, Package, Procedure, Function, Trigger, Materialized View , View, Index should be meaning full and start from Module name
Prefix Module Name
SET Settings
SEC Security
HRS Human Resource System
PAY Payroll
TOM Time Office Management
OSP Office Support Portal
ESS Employee Self Service / Web Portal General Settings
COM Communication System
MRR Meeting Room Reservation
HRS_EREC E-Recruitment
ARC Correspondence System
INV Inventory Module
FIN Finance Module
PUR Purchase Module
CON Contract Module
DFS Date Factory System
  • Example Naming Standard of Database Objects for Table Specific
Objects Module Prefix Object Name Object Type Suffix Example
Table SET_ TABLE_NAME SET_LOCATION
View SET_ TABLE_NAME _VW SET_LOCATION_LOC_ID_SEQ
Sequence SET_ TABLE_NAME_COLUMN_NAME _SEQ SET_LOCATION_LOC_ID_SEQ
Package SET_ TABLE_NAME _PKG SET_LOCATION_PKG
Procedure SET_ TABLE_NAME _PRO SET_LOCATION_ PRO
Function GET_ TABLE_NAME ColumnName GET_LOCATION_NAME
Trigger SET_ TABLE_NAME _TRG SET_LOCATION_ TRG

<_BU> (Before Update) <_BI> (Before Insert) <_AU> (After Update) <_AI> (After Insert)

Materialized View SET_ TABLE_NAME_COLUMN_NAME _MV SET_LOCATION_ MV
Index SET_ TABLE_NAME _IDX SET_LOCATION_LOC_ID_IDX
Constraints SET_ TABLE_NAME_ ColumnName _IDX SET_LOCATION_LOC_ID_IDX
Constraints SET_ TABLE_NAME_ ColumnName _PK_UK_CK_NN_FK SET_LOCATION_LOC_ID_PK, SET_LOCATION_LOC_ID_UK,SET_LOCATION_LOC_ID_CK,SET_LOCATION_LOC_ID_NN,SET_LOCATION_LOC_ID_FK
  • Example Naming Standard of Database Objects for General use
Objects Suffix Abbreviation Example
Package _PKG ModuleName / MeaningFullName ModuleName_Reports_PKG (For Reports) ModuleName_PKG (For general user for whole module) HRS_LEAVE_PKG INV_REPORTS_PKG DFS_COMMON_PKG
Procedure _PRO ModuleName / MeaningFullName / Table Name INV_ITEM_BALANCE_PRO
Function GET_ ModuleName / MeaningFullName GET_HIJRI_NEXT_MONTH
Trigger TRG_ ModuleName / MeaningFullName,<_BU> (Before Update) <_BI> (Before Insert) <_BD> (Before Delete) <_BF> (Before insert, update, delete) <_AU> (After Update) <_AI> (After Insert) <_AD> (After Delete) <_AF> (After insert, update, delete) <_IU> (Instead of Update) <_II> (Instead of Insert)<_ID> (Instead of Delete) <_IN> (Instead of insert, update, delete) TRG_LOCATION TRG_LOCATION_BF TRG_LOCATION_BI TRG_LOCATION_AU TRG_LOCATION_AI
Materialized View _MV ModuleName / MeaningFullName / SET_LOCATION_MV