Note: You may wish to view the how-to video on this subject.
Hackolade includes the ability to maintain both a ‘business name’ and a ‘technical name’ for objects (containers, entities, and attributes.) To facilitate the maintenance of these 2 names, it is possible to keep them synchronized and transformed based on a set of user-driven parameters, and optionally based on a conversion file maintained outside of the application. Name conversion can go both directions: Business-to-Technical, or Technical-to-Business. Furthermore, when performing reverse-engineering, it is assumed that the database instance contains technical names, to be transformed in business names.
If you do not wish to use this feature, keep disabled the Name Coupling parameter (see below) and simply leave the technical name property blank, so the (business) name property is used by default.
Starting with version 4.1.2, we have replaced global parameters with separate target-specific parameters to allow different behavior depending on target. Also, the parameters are stored in a JSON file in the C:\Users\%usernames%\.hackolade\options\<targetname> directory, so they can be shared with teammates via Git.
1. Conversion file
A conversion file is not mandatory to use the Naming Conventions feature. A conversion file is a .csv file listing words that may appear in object names (business name), with a corresponding technical name to use instead in database definition scripts.
The conversion file is made of at least 2 columns, with Business name as a first column, and Technical name as the second column. Additional columns are ignored by Hackolade. The columns are separated by commas. The first line is the header line, and is ignored in the conversion. The lines are separated by a <CR><LF>. There is no limit to the number of lines in the file. The values in the columns are not case-sensitive. A case conversion may be applied in the conversion parameters, cfr below.
Business Name,Technical Name,Optional Description
2. Conversion parameters
To modify the behavior of the name sync feature, user options can be set in Tools > Options > Naming Conventions:
Enable auto-complete: when this option is enabled, auto-completion is active to use the conversion file to type-ahead names as they are created.
Default name coupling: 3 options are available from the dropdown box: No, Business-to-Technical, or Technical-to-Business.
Specify path and file name of the conversion file, or choose to Convert without a file and using the only the rules specified below
Display: choose to see the Business name or the Technical name in the Object Browser, ER Diagram and Tree view
Business-to-Technical Conversion: the following options, if enabled will be applied after the file conversion (with or without file.)
Remove vowels: when this option is enabled, the vowels in the name are suppressed
Invalid characters: the characters declared can optionally be removed or replaced by another character. Example of invalid characters: "!?.,:;()=+-*@/\", and replacing character: "_"
Case conversion: choose from the dropdown:
- none: no case conversion is performed
- camelCase: also know as lowerCamelCase, words are joined together, and the first letter of the first word is lowercase, while the first letter of the subsequent words is capitalized
- PascalCase: also know as UpperCamelCase, words are joined together, and the first letter of every word, including the first one, is capitalized
- lowercase: all letters are converted to lowercase
- UPPERCASE: all letter are converted to UPPERCASE
- snake_case: all letters are converted to lowercase, plus words are separated with a underscore "_"
- kebab-case: all letters are converted to lowercase, plus words are separated with a dash "-"
- dot.case: all letters are converted to lowercase, plus words are separated with a dot "."
- path/case: all letters are converted to lowercase, plus words are separated with a slash "/"
Technical-to-Business Conversion: the following options, if enabled will be applied after the file conversion (with or without file.)
Case conversion: If enabled, a space is inserted between words detected in the technical name (based on the presence of a separator such as underscore (‘_’), a dash (‘-‘), a dot (‘.’), a slash (‘/’), or simply an Upper case letter). Choose from the dropdown:
- none: no case conversion is performed
- lower case: all letters are converted to lowercase
- UPPER CASE: all letter are converted to UPPERCASE
- Proper case: the first letter of every word is capitalized – no exceptions
- Title case: the first letter of every word is capitalized, except for certain small words, such as articles and short prepositions
- Sentence case: only the first letter of the sentence or phrase is capitalized
Upon exit of the dialog (via OK or Apply) after making a change in parameters, the user will be prompted to choose whether: to apply the changes to just previously coupled names, to apply the changes to all object names, or to not apply any of the changes performed by canceling the dialog.
3. Properties Pane
In the properties pane, the relationship between business name and technical name can have 3 states: OFF (default), convert Business name to Technical name, or convert technical name to business name. This state can be set separately for each individual object. To set Naming Conventions to control the business names and technical names of all objects, select Tools > Options > Naming Conventions, then choose either Business-to-Technical or Technical-to-Business from the dropdown "Enable name coupling".
Let’s say we have this starting situation:
To indicate that coupling is OFF between business and technical name, the 2 = sign icons to the right are un-selected. The user could simply type the technical name of his choice, without any compliance to the glossary file.
Now, if the user wants to apply naming convention by using the conversion file referenced in the parameters, he would just click on the = sign to the right of the Technical name:
where the = sign icon shown as pressed, and the Business name is converted into the Technical name by using the conversion file and other conversion parameters. While the = sign icon is ON, the Technical name field is locked and cannot be edited.
If the Technical name = sign icon is pressed again, the entry field is unlocked and the entry can be edited again:
If the Business name = sign icon is pressed this time, the Technical name is converted into the Business name by using the conversion file and other conversion parameters. While the = sign icon is ON, the Business name field is locked and cannot be edited.
4. Behavior during Reverse-Engineering
During Reverse-Engineering, if coupling parameters is set to 'No', then all object names from the source (whether from a DB instance, XSD, DDL, Excel, JSON, etc...) are stored in the Business Name property.
If coupling is set to either Business-to-Technical, or Technical-to-Business, the result of the Reverse-Engineering is the same. In both cases, the object names from the source are stored in the Technical Name property and converted to Business Name using the conversion parameter. That's intuitively obvious when the coupling parameter is set to Technical-to-Business.
But you may wonder why the handling is done as such when the coupling parameter is set to Business-to-Technical... The following dialog is presented to the user:
The only safe method we can ensure is one by which the Technical Name come from the source is preserved, no matter the conversion parameters. Say we have a source object called cust_acct and the Technical-to-Business is set in such a way that the Business Name becomes Cust Acct. If the application applies Business-to-Technical conversion that would be set for example to camelCase, the Technical Name would be changed to custAcct, thereby losing the original cust_acct in the source. We prefer to let the user choose the expected outcome to either keep it as is, or to change the parameters and apply these changes to the model.
5. Clearing all Technical Names
You may wish to disable any coupling between Business and Technical Names and maintain both manually. You may also decide that you want to empty all Technical Name properties. You may do so by setting coupling to No. When you get the following dialog:
you may choose to check the box "Clear all Technical Names". Be careful of course. You may want to save a version of your model prior to applying this clearing, and test that the behavior matches your expectations.
6. Advanced stuff
You should know that there's a hierarchy in our transformations:
- conversion file
- invalid characters
- case conversion
Plus we natively use 2 word separators when parsing the input line: blank (' ') and underscore ('_')
How you set the Invalid Characters behavior is important, as it affects the case conversion behavior. Say, for example that you have camelCas conversion with this Invalid Characters setting:
Going through "Customer Account", first we convert the word with the conversion file to "cust acct", then with the Invalid characters config, we remove the blank and get "custacct", but we've lost the word separator, therefore camelCase does not see the "acct" as a separate mode. The end result is: "custacct".
If however, you do a replace blank by underscore:
the sequence becomes "cust acct" then "cust_acct", then "custAcct" which is the expected behavior.