Home

Object attributes should comply with a naming convention

Description

    The Pl_Sql code rule "Object attributes should comply with a naming convention" states that all object attributes must adhere to a consistent naming convention. This ensures that the code is easier to read and understand, and that any changes to the code can be quickly identified. The naming convention should be documented and followed by all developers, and should include rules for capitalization, abbreviations, and the use of underscores. This will help to ensure that the code is consistent and maintainable.

Key Benefits

  • Ensure Consistency: Object attributes should comply with a naming convention rule to ensure consistency and readability.
  • Readability: Naming conventions make code easier to read and understand, as the names of variables, functions, and other objects are more descriptive.
  • Maintenance: Naming conventions make it easier to maintain code, as it is easier to identify and modify code that follows a consistent pattern.
  • Error Prevention: Naming conventions can help prevent errors, as the names of variables and functions are more descriptive and easier to remember.

 

Non-compliant Code Example

CREATE TYPE CUSTOMER_T AS OBJECT
( 
    FirstName_ VARCHAR2(50),    --Non compliant code (Not comply with naming convention)
    LastName_ VARCHAR2(50),     --Non compliant code (Not comply with naming convention)
    Area VARCHAR2(100),
    City VARCHAR2(100)
);

Compliant Code Example

CREATE TYPE CUSTOMER_T AS OBJECT
( 
    FirstName VARCHAR2(50),    --Compliant code (Comply with naming convention)
    LastName VARCHAR2(50),     --Compliant code (Comply with naming convention)
    Area VARCHAR2(100),
    City VARCHAR2(100)
);
Visual Expert 2024
 VEPLSQLRULE116