Naming Conventions

A naming convention is a generally agreed scheme for naming things. We use it to unify the way we name entities, fields, columns and tables. ORIGAM development team has a few naming conventions that we recomend when working with ORIGAM architect or related database. We do our best to follow these conventions/rules in all of our projects.

Basics

  • It’s important to keep the naming consistent throughout a given project. If the project already has set naming conventions it’s best to follow them. If they need to be changed, it’s necessary to change them in the whole project.

    • For example we might want every field with a date to have the word Date in the name as a prefix. So it is easy to filter all date fields. DateCreated
  • It is best to take some time and plan the naming conventions in advance before you start working on the project.

  • Fields are always named in singular. Other parts depend on specific projects. Other components can either have singular or plural names. It doesn’t matter which one. Just keep it consistent.

Rules

  • All names except foreign key follow the PascalCase case style. Every word starts with a capital letter and there is no space in between. ExpirationDate

  • We don’t use symbols, punctuation, spaces or capitalized words. COLUMN #952

  • It´s a good practice to use names that are self explanatory, concise and descriptive so we can easily guess from the name what the field or column is used for without the need for explaination. Of course if the project is large the names may start growing in lenght as well MinimalRequiredExpirationDate

  • Foreign key names always start with ref followed by foreign entity name followed by foreign key Id. refProductId refers to the table Products and the field Id. This is the only situation when we use camelCase.

Example

  • We want to create a field for a minimum expiration (let’s say 21 days from production).

  • In the first case we need the number of days to expiration (the field’s data type is integer) and so we could name the database field ExpirationDays, MinimalExpirationDays or even MinimalRequiredExpirationDays.

  • In the other case we need the date on which an item expires (the field’s data type is date) and so we could name the database field ExpirationDateDate or MinimalExpirationDate etc.

  • Anything (entity, field, lookup, etc.) refering to those fields would be named accordingly.