Naming Convention

A system needs to find and address different objects efficiently and accurately while remaining easy to understand, develop and keep up.

You need a scheme that allows you to uniquely reference each object in a way that is both machine and human readable. The scheme describes each object within the business domain the system supports.

Come up with a naming convention that names objects for their content, and possibly their role, within the business domain. Avoid naming based on internal workings of the object, such as SLS_ORDR_VW, CRC32_CHKSUM, or intPersonWeight. Namespaces — database, schema, table, etc. — provide context to underlying objects, do not cram that context into an object’s name. Unit of measure is not an internal aspect of an object as it changes the meaning of the content the object represents.

ColumnName = (DescriptionContext) Description (DomainContext) Domain

Decide on a name syntax for objects; it describes how to form names. While different object types can have different name syntaxes, keep the number of syntaxes small, strive for three or less. You also choose an abbreviation scheme as necessary. Finally, and most important, apply your naming convention consistently everywhere.

Names are primarily a handle for people, as systems do not value the difference between OBJ1234 and CUST_NM. So, good names instantly convey meaning that otherwise is only available through tacit knowledge or locked away in a document somewhere.

A naming convention that changes names when implementation changes demands that everyone referring to it dances to its tune. It creates unnecessary coupling and makes the object name a “kitchen sink” of different meanings. This includes less obvious values like _DIM and _FACT suffixes as Jeff Kanel commented in the TDWI BI and DW Discussion group on LinkedIn. For example: Customer is hardly a fact, as Sales Order is hardly a dimension. Sales Order Status? Clearly a dimension.

If _KEY means surrogate key, that indicates content; if _KEY means primary key, that indicates function. A surrogate key has as its sole purpose to substitute a primary key, hence content follows function and the separation becomes difficult to see.

If namespaces do not give enough context to properly name the object, it might become necessary to add the role to the name, not the function. Imagine an employee table with an EMPLOYEE_KEY and you need to have a self-referencing foreign key to document the organizational structure. Name it MANAGER_EMPLOYEE_KEY to show its role, not EMPLOYEE_FKEY to show its function nor MANAGER_KEY where the manager role replaces the employee meaning.

As a last comment, consistency and good naming patterns allow logic that can make decisions based on the object name. Your solutions can become more flexible at the cost of a more disciplined naming convention.

Principle Trade-offs
Extend your understanding<Know your limits
Stay relevant<Build enduring
Do right=Share

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="">