Apply Naming Standards to a Model

After you define naming standards using the NSM Option Editor, select individual model objects and apply the standards. The glossary words and abbreviations (or alternate abbreviations) that are defined in the active NSM Option object are applied as naming standards to a model.

Follow these steps:

  1. Open a model that includes an active NSM Option object.
  2. Click Actions, Model Naming Options.

    The Model Naming Options dialog opens.

  3. Click the Name Mapping tab.
  4. For each model object type that you want to use the glossary, select the Use Glossary check box and select the type of abbreviation. Click OK.

    The naming standards are applied when you switch from a logical model to a physical model.

    In a Logical/Physical model, define the naming standards, create the abbreviations, and select the object that uses the glossary in the Logical view. Switch from the Logical view to the Physical view and the standards are applied.

    In a Logical Only (LO) or a Physical Only (PO) model, define the naming standards, create the abbreviations, select the object that uses the glossary, and then derive a PO or an L/P model. In the Derive Model wizard, go to Naming Standards. Select the model that has an active NSM object as the active model template. The naming standards are applied to the derived model.

Note: The translation from logical to physical through the NSM Option Object works only if the physical name is inherited from the logical name. That is, only if the names have not been manually changed in the physical model. If a physical name is modified in a logical/physical model, the inheritance from the logical side to the physical side is overridden. The naming standards no longer work. However, you can reset the override property to inherit from the logical name to restore this inheritance.

NSM File Attached to an Older Version Model

When you open a model from an older version of the product, it is upgraded to the current release. If an NSM file was attached to the model, the file is not imported and attached to the model automatically. Import the NSM file to a template and attach the template to the model manually.

Back to Top

Example

Use this example to create database specific templates and standardize database specific properties across all your data models. If you want to include the Naming Standards in each database specific target template, you must change the naming standards glossary list for each template. You must change the glossary for each template, because the Naming Standards information is stored within a model. This section describes how you can manage Naming Standards from a single source.

Follow this process:

  • Create a logical-only model template with general model set up criteria and include the Naming Standards information.
  • [Optional] Create a database specific template and use this template as the binding source and select the �Synchronize on Model Load� option.
  • Attach this template as the binding template source for your model and select the Synchronize on Model Load option.

    If you have to change something in the glossary, you just change the Naming Standards object in the logical model template and save the template. When you open a model, if the auto-synchronize option is enabled, the database specific template model is opened. Next, the logical model template is opened and the Naming Standards object is synchronized with the database specific template. The remaining template information is also populated in the new model.

Example

This section includes two examples with two different databases�DB2 and Oracle. The examples use templates that are stored in a Mart.

  1. Create a logical model template that includes the following basic standards desired for all data models:
    • A standard theme.
    • An Annotation that enables the model name to be presented on diagrams (a type of legend).
    • Standard Domains.
    • Standard Entity level User Defined Properties (UDP) that can be shared among all data models.
    • A set of start-up diagrams. Each diagram includes a diagram shape to enable the presentation of the diagram name in each diagram.
    • A Naming Standards object.
  2. Open this model and save it to a Mart as a template; provide the name �TmplGeneral�.

    To create each database specific template in erwin:

    1. Click File, New.
    2. Select Type as Logical/Physical.
    3. Select the Target Database as Oracle.
    4. Select TmplGeneral for Model template.
    5. Select Preserve the template binding.

    You now have a logical/physical model with all the pre-populated information from the TmplGeneral logical model template. You can add any common DB2 characteristics that you want all your DB2 models to share.

In addition, make the following changes:

  1. Click Model, Model Properties and change the model name to TmplDb2.
  2. Click Model Explorer, Annotations - Change the Annotation to reflect the model name:
  3. Perform the following steps to prevent the over writing of model names during synchronization:
    1. Click File, Model Template, Run the Template Wizard. The Model Template Synchronization Wizard appears.
    2. Go to the Model page and change the action of the Annotation object named �ModelLegend� to Ignore. This setting bypasses synchronizing the model name.
    3. In the Settings page, select the Ignore synchronization of the root model object option. This setting prevents over writing of the model level properties from the logical only model.
    4. Click Finish.
  4. Select Actions, Model Naming Options. Verify whether the Use Glossary option in the Name Mapping tab is set for the model objects for which you want to leverage the naming standards glossary.
  5. Also, as these diagrams were synchronized from a logical only model, go to the Diagram Properties dialog for the Physical Overview and Relational Key diagrams and change the View Mode to �Physical�.
  6. Save this model to your mart library as model name �TmplDB2� (with the Mark as Template option)
  7. Repeat these steps for each database specific template (i.e. SQL Server, Oracle, Teradata, etc.). With this, you can add any database specific properties in your templates to use across all application data models.

    You can now use these database specific templates for your application data models. Either create a new model, or, bind an existing data model to the database specific template model manually. If you are binding an existing model, review the model to verify that no properties in the template model will cause issues with the existing model when synchronized.

In this example, creating a new application data model using the template is used as a starting point.

  1. Select File, New.
  2. Select Match template.
  3. Select the TmplDB2 template model from the Mart.
  4. Select Preserve the template binding option.
  5. Click OK.

    Now you have a DB2 application data model with all the properties from both the TmplGeneral template and the TmplDB2 template.

  6. If you use the Annotation ModelLegend text box, select Ignore in the template. Selecting ignore prevents this object from being updated during synchronization.
  7. Save this model to your Mart library. To follow this example, save it as model �AppModelDB2�.
  8. To test the synchronization process, add a few Entities in the �Logical Overview� diagram and drag/drop the domain �Identification� as primary keys to both Entities. (Select the Identification domain and drag it to the primary key locations in each Entity).
  9. Select the �Physical Overview� diagram. Notice that the word Identification changed to its abbreviation from the Naming Standards Glossary.
  10. Save and Close the model as AppModelDB2.
  11. Open the original model template TmplGeneral and change the abbreviation for Identification from �Id� to �Idnt�.
  12. Save and close this model.
  13. Open model AppModelDB2.

    Notice that the abbreviation is automatically applied through the template hierarchy to this application data model for DB2.