Metaclasses (Profile)

Metaclasses are defined in the PowerDesigner metamodel and provide the basis for your extensions. You add a metaclass to the Profile category when you want to extend it in some way by modifying its behavior, adding new properties, changing its property sheet or symbol, or even excluding it from your models.

You can either make extensions to an existing type of object or create an entirely new kind of modeling object by adding the ExtendedObject, ExtendedSubObject or ExtendedLink metaclass (see Extended Objects, Sub-Objects, and Links (Profile)).

In the following example, the FederationController is an entirely new type of object created by adding the ExtendedObject metaclass and defining a stereotype on it. Various specializations of the Table metaclass are defined through criteria and stereotypes:


Extensions are inherited, so that any extensions made to a metaclass are available to its stereotyped children, and those that are subject to criteria. The various extended attributes defined under the table metaclass will be available to table instances according to the following rules:
  • SecurityLevel - All tables.
  • EncryptionKey - Tables for which the SecureTable criterion evaluates to true.
  • ReplicationPath - Tables for which both the SecureTable and Replicated criteria evaluate to true.
  • ExternalLogin - Tables bearing either the FederatedTable or PriorityTable stereotype.
  • Availability - Tables bearing the PriorityTable stereotype.

For example, a table bearing the FederatedTable stereotype, and for which the SecureTable criteria evaluates to true, would display the SecurityLevel, EncryptionKey, and ExternalLogin attributes, while a table bearing the PriorityTable stereotype, and for which both the SecureTable and Replicated criteria evaluate to true, would display these attributes and, additionally, the ReplicationPath and Availability attributes.

  1. Right-click the Profile category and select Add Metaclasses:
  2. Select one or more metaclasses to add to the profile. The sub-tabs list metaclasses belonging to the present module (for example, the OOM), and standard metaclasses belonging to the PdCommon module.


    [optional] Use the Modify Metaclass Filter tool to display:
    • All metaclasses
    • Concrete metaclasses - for object types that can be created in a model, such as Class or Interface.
    • Abstract metaclasses -which are never instantiated but are used to define common extensions. For example, add the Classifier metaclass to your profile to define extensions that will be inherited by both classes and interfaces.
    Note: For information about viewing and navigating among metaclasses in the metamodel, see The PowerDesigner Public Metamodel.
  3. Click OK to add the selected metaclasses to your profile:


  4. [optional] Enter the following properties as appropriate:

    Property

    Description

    Name

    [read-only] Specifies the name of the metaclass. Click the button to the right of this field to open the Metamodel Objects Help for the metaclass.

    Parent

    [read-only] Specifies the parent of the metaclass. Click the button to the right of this field to go to the parent. If the parent is not present in the profile, a message invites you to add it.

    Code naming convention

    [concrete metaclasses in target files] Specifies the default format to initialize the name to code conversion script for instances of the metaclass. The following formats are available:
    • firstLowerWord - First word in lowercase, then other first letters of other words in uppercase

    • FirstUpperChar - First character of all words in uppercase

    • lower_case - All words in lowercase and separated by an underscore

    • UPPER_CASE - All words in uppercase and separated by an underscore

    For more information on conversion scripts and naming conventions, see Core Features Guide > Modeling with PowerDesigner > Objects > Naming Conventions.

    Illegal characters

    [concrete metaclasses in target files] Specifies a list of illegal characters that may not be used in code generation for the metaclass. The list must be placed between double quotes, for example:

    "/!=<>""'()"

    When working with an OOM, this object-specific list overrides any values specified in the IllegalChar property for the object language (see Settings Category: Object Language).

    Enable selection in file generation

    Specifies that instances of the metaclass will appear in the Selection tab of the extended generation dialog box.

    Exclude from model

    [concrete metaclasses only] Prevents the creation of instances of the metaclass and removes all references to the metaclass from the menus, Toolbox, property sheets and so on, to simplify the interface. For example, if you do not use business rules, select this check box for the BusinessRule metaclass to hide them in your models.

    When several resource files are attached to a model, the metaclass is excluded if at least one file excludes it and the others do not explicitly enable it. For models that already have instances of this metaclass, the objects will be preserved but it will not be possible to create new ones.

    Comment

    Documents the reason for the presence of the metaclass in this profile.