Common Naming Conventions
When defining entity names, it's recommended to follow a few simple rules consistently throughout the entire application. This practice significantly improves clarity, structure, and reduces the potential for errors.
Basic Naming Rules:
- Rule 1: Do not use more than one consecutive space between words.
- Rule 2: The first and last characters of a name must always be alphanumeric (A–Z, a–z, 0–9). Avoid using any special characters or spaces at the start or end of names.
- Rule 3: Select one (ideally) or at most two special characters consistently for separating logical units or hierarchy levels within the name. Allowed special characters are dots (
.
), dashes (-
), slashes (/
), and underscores (_
). - Rule 4: Always use spaces to separate words that together form a single logical concept or term.
Practical Example:
A clear example is the order type name:
“Residential / Internet / Soft Suspend”
Here, a hierarchical structure is clearly represented. The order type applies to the Residential customer segment and the Internet product, separated by a special character /
. Soft Suspend is a single logical concept, so the two words "Soft" and "Suspend" are separated only by a space.
These naming rules are important not only for aesthetic reasons, clarity, and readability but also because the entity Name is used as the basis for generating the structured identifier known as the Code, described in the previous section.
Recap - What is a Code?
- Code: A structured, human-readable identifier utilized across APIs, integrations, and internal configurations.
The Code is usually generated automatically from the entity’s Name. Although it can be manually adjusted with some restrictions, manual changes are strongly discouraged unless explicitly necessary.
Automatic Code Generation Process:
The automatic generation of the Code from the entity Name occurs in several steps:
-
Removing Accents & Trimming:
Converts accented characters to standard ASCII characters and removes extra spaces. -
Normalizing Punctuation:
Replaces any sequence of dots (.
), dashes (-
), slashes (/
), or underscores (_
) with a single dot (.
). -
Removing Special Characters:
Eliminates characters other than letters, digits, spaces, and dots. -
CamelCase Conversion:
Splits the cleaned string into segments by dots. Each segment is then transformed into CamelCase (e.g., “soft suspend” → “SoftSuspend”), and segments are joined again using dots.
Benefits of Automatic Code Generation:
This process ensures the generated Code is:
- Structured: Clearly reflects the entity’s hierarchy and related configurations.
- Readable: Makes the entity’s purpose clear at first glance.
- Consistent: Maintains uniform naming conventions across all modules and entities.
Following these guidelines and leveraging automatic code generation promotes consistency, improves the solution’s quality, and significantly simplifies maintenance and integration tasks.