Databases Reference
In-Depth Information
Naming Conventions
We have learned that the consistent use of clear and simple rules for naming any kind of element has a
huge impact on the quality of the software and the productivity of the developers. Next, we will cover a
suggested naming scheme for naming the database objects as well as the files and folders.
Naming Conventions for Database Objects
There are many legitimate approaches for naming the database objects. You don't have to follow our
suggestion, just make sure that you document your conventions and follow them consistently.
Oracle has a 30-character limit on object names. It quickly becomes a challenging task when you try
to use expressive table and column names. This makes a consistent use of concise rules even more
crucial.
We will explain our preferred naming conventions using the sample application described before.
The overall naming scheme for any database object follows this generic structure:
<application prefix> <object name> <functional area> <object type>
Application Prefix: The application prefix describes the application, e.g., FM for our
facility management application. You could use the application prefix also for
including external or reusable software packages. For example, we use the prefix
WF for our workflow engine and XLIB for a collection of packages we tend to reuse
in our projects.
Object Name: This is the object name describing the entity or technical
relationship, e.g., LOCATIONS .
Functional Area: This is the optional functional area, e.g., staging area ( STA ). This is
used to differentiate between the regular table FM LOCATIONS and the staging area
FM LOCATIONS STA to load the data from an external source.
Object Type: The object type is appended at the end to differentiate between the
different object types. In Table 9-2 you can see a list of objects and their suffixes.
Table 9-2. Object Type Suffixes
Object Type
Object Type Suffix
Example
Comment
CHK
Check that topic booked until >
book booked from :
BOOK PERIOD POSITIVE CHK
Constraint (Check)
Constraint (Unique) UC
Unique key on the login name:
USR LOGIN NAME UC
<no suffix>
Function
Look up the user id for a given login
name:
GET USR ID(p login name)
For true API interfaces
(functions, procedures,
packages) we don't use a
suffix.
Search WWH ::




Custom Search