Customization > Extensibility Through Profiles, Stereotypes, Tag Definitions and Scripts > Extensibility through stereotype scripts and script items > Extending model item properties through stereotypes and tag definitions > Overview of extending model item properties through stereotypes and tag definitions
  
Overview of extending model item properties through stereotypes and tag definitions
Stereotypes and Tag Definitions provide a controlled way of extending the properties of any item in a model:
A Tag Definition defines a new property. If you apply a Tag Definition to a model item, the Tag Definition appears on the model item's Property Pages so that its value (tagged value) can be set for the model item. You cannot apply a Tag Definition directly to a model item, you must apply a Tag Definition to a model item through a Stereotype.
A Stereotype applies one or more Tag Definitions to a model item.
The following section provide more detailed information about using Tag Definitions and Stereotypes to extend model item properties.
Tag Definitions
You apply a Tag Definition to a model item through a Stereotype, that is, you link the Tag Definition to a Stereotype, and then link that Stereotype to the model item.
After linking a Stereotype to a model item, the model item's Property Pages include a tab for the linked Stereotype. The name of the new tab is that of the Stereotype. The Property Pages tab created for a Stereotype displays each of the Stereotype's Tag Definitions that are published and not hidden. If a shown Tag Definition is not read only, you can set its value on the Property Pages tab. The value you set is called a tagged value.
* 
After creating and defining a Tag Definition, it cannot be used until it is published. When you publish a Tag Definition, its Data Type is made read only so that property values (tagged values) cannot be invalidated by changes to the Tag Definition's Data Type. You publish a Tag Definition through the Publish button on the Usage tab of the Tag Definition's Property Pages.
A Tag Definition can be used by many Stereotypes, but it can have only one value for a model item. If a Tag Definition is applied to a model item through more than one Stereotype, it will have the same value in each case. The name of a Tag Definition must be unique within a model.
You define a Tag Definition and its usage through the Tag Definition's Property Pages:
The General tab allows you to specify the Name of the Tag Definition, which is used for the name of the new property.
The Type tab allows you to specify the type of the new property:
Boolean - Specifies that the Tag Definition stores a Boolean value. When selected, you can set the Default Value property to TRUE or FALSE.
Enumeration - Specifies that the Tag Definition stores an Enumeration. When selected, you can specify enumeration Values and a Default Value.
Note that you can add and remove enumeration Values after the Tag Definition has been published. If you remove an enumeration Value for which a tagged value has been set, the tagged value will remain until it is set to a new valid value.
Reference - Provides a mechanism for linking a model item with a model item of any other type. When selected, you can specify valid Model Item Types. For more information, see Overview of extending linking capabilities through stereotypes and tag definitions.
Rich Text - Specifies that the Tag Definition stores rich text. When selected, you can specify a Default Value for the rich text.
Text - Specifies that the Tag Definition stores text. When selected, you can specify a Default Value for the text.
Derived - This property is used for advanced customizations and the development of ergonomic profiles. For more information, see Derived (property of tag definition).
The Usage tab allows you to specify the following information:
Browsable - Specifies that a Tag Definition appears in a pane created for a browsable profile Package.
Hidden - Specifies that a Tag Definition is hidden when applied to a model item through a Stereotype, that is, the Tag Definition is not displayed on the item's Property Pages. Some Add-ins make use of hidden Tag Definitions.
Inverse Name - Specifies an inverse name for a reference Tag Definition. If an item is referenced through a Tag Definition, the inverse name of the Tag Definition is listed on the Items tab of the referenced item's Property Pages. When the inverse name is selected on the Items tab, the referencing items are listed.
Mergeable - This property is no longer used.
Read Only - Specifies that when applied to a model item through a Stereotype, the value of a Tag Definition cannot be edited through the Modeler user interface. The value of the Tag Definition can be edited through the automation interface, unless the Tag Definition is derived. Some Add-ins make use of read only Tag Definitions.
Show on All Diagrams - Specifies that if an associated Stereotype is shown on a diagram, the Tag Definition is shown without having to link the Tag Definition to the diagram as a Shown Tag Definition.
The Style tab defines a style for the Tag Definition.
The Derivation Script tab is used for advanced customizations and the development of ergonomic profiles. For more information, see Derivation script (property of tag definition).
The Contents tab allows you to define properties of items to display in the Contents pane, that is, items that are linked through reference Tag Definitions.
The Items tab allows you to link the Tag Definition to Stereotypes.
There may be occasions when you want to remove or change a Tag Definition after it has been applied to one or more model items. You should be aware of the following behavior:
If you add a Tag Definition to a Stereotype, the new Tag Definition will be available on the Property Pages of items the Stereotype has been applied to.
If you remove a Stereotype from an item, any tagged values set for Tag Definitions applied only by that Stereotype are deleted. If you later apply the Stereotype to the item, the previously set tagged values will not be set.
If you remove a Tag Definition from a Stereotype, the Tag Definition will be removed from the Property Pages of items the Stereotype has been applied to. If the Tag Definition is reinstated, the previously set tagged values will still apply, because any tagged values that have been set for a model item remain when a Tag Definition is removed or deleted.
If you change properties of a Tag Definition, such as its Default Value or Read Only status, the new properties will apply to items the Tag Definition has been applied to. Note that you cannot change the Data Type of a published Tag Definition, but you can delete a published Tag Definition and replace it with a new Tag Definition that has the same name. For more information, see Changing a tag definition's data type after it has been published.
* 
You require Repository Administrator, Repository Owner or Database Write access permissions to publish a Tag Definition. If a Tag Definition is not linked to any Stereotypes that have model item types defined, you can publish that Tag Definition without repository write access permissions; however, having published the Tag Definition, you require database write access permissions to make the Tag Definition useable, that is:
Link the Tag Definition to a Stereotype that has model item types defined.
Define model item types for any linked Stereotypes.
Stereotypes
In the context of extending model item properties, a Stereotype is a collection of referenced and inherited Tag Definitions. You apply a Stereotype's Tag Definitions to a model item by linking that model item to the Stereotype. A model item can be linked to many Stereotypes.
To ensure that Stereotypes are applied only to model items of an appropriate type, you must specify valid model item types for a Stereotype. To specify valid model item types for a Stereotype:
On a Profile Diagram, create Extensions links between the Stereotype and the appropriate Meta Model Types.
From the Stereotype's Property Pages, click the Items tab, and then in the drop-down list box select Model Item Types. Click the Link button and then select the check boxes associated with the valid model item types.
After linking a Stereotype to a model item, the model item's Property Pages include a tab for the linked Stereotype. The name of the new tab is that of the Stereotype. The Property Pages tab created for a Stereotype displays each of the Stereotype's Tag Definitions, except for those that are hidden.
You can automatically link a Stereotype's Tag Definitions to all model items that have a valid model item type for the Stereotype. To automatically link a Stereotype's Tag Definitions to items that have a valid model item type, from the Stereotype's Property Pages, click the Options tab, and then select the 'Apply to All Objects of Associated Model Item Types' check box. Note that when an item is stereotyped through the 'Apply to All Objects of Associated Model Item Types' check box, the Items tab of the item's Property Pages does not list the Stereotype as an associated Stereotype. In addition, this option does not apply other Stereotype options, such as Override Type Name, to any items.
A Stereotype can hide item specific tabs from an item's Property Pages, so that only the following tabs are shown: General, Custom, Style, Items and any tabs for applied Stereotypes. Note that this functionality has not been implemented for items associated with Table Relationships diagrams and the now obsolete System Architecture Diagram.
Plan your Stereotypes carefully so that they can be used efficiently. Remember that a Stereotype can use many Tag Definitions.
* 
If you link a Stereotype to an item and then set up that item's type as invalid for the Stereotype, Modeler removes the link between the Stereotype and the item.
You can view the relationships between Stereotypes and Tag Definitions in the following ways:
The Items tab of a Stereotype's Property Pages lists its linked Tag Definitions.
The Items tab of a Tag Definition's Property Pages lists its linked Stereotypes.
The Miscellaneous folder in the Relationships pane shows the Stereotype and Tag Definition structure.
On a Profile Diagram.
Stereotype Inheritance
On a Profile Diagram you can define Stereotype inheritance by creating a Generalization between two Stereotypes. A sub Stereotype inherits the parent Stereotype's valid Model Item Types, Tag Definitions and Scripts. When a sub Stereotype inherits Tag Definitions, you can redefine those Tag Definitions independently of the super Stereotype's Tag Definitions. To redefine a Tag Definition: right-click the Tag Definition, and then click Redefine.
Note that you cannot select the Apply to All Objects of Associated Model Item Types check box when a Stereotype is a sub Stereotype or super Stereotype.