Profiles

A profile is supported by a package stereotyped profile, the main goal is to define stereotypes, themselves supported by classes stereotyped stereotype. A Stereotype has attributes producing properties on the element having this stereotype. Plug-outs can be associated to a stereotype to automatically call them when an element receive the stereotype or when the element was edited (the plug-outs are not called when the modifications are made through a plug-out). A profile can define standard classes, probably enumerations to type the stereotype's attributes.

When you stereotype an element you can choose to use a stereotype defined in a profile, or a non modeled stereotype (pure text).

When the set stereotype is defined in a profile, the associated properties (may be inherited) are automatically added to the element with the specified default value (may be empty), then the plug-out optionally associated to the setting of the stereotype is applied to the element receiving the stereotype. This is done after validating the new stereotype by validating the element edition through its dedicated dialog, so, if you want to modify the element's properties associated to its stereotype you have to edit the elements two times : one to set the stereotype, the second to set the properties to the desired values. Nothing is done when the stereotype is set through a plug-out.

When you unset or change the stereotype and it was a stereotype defined in a profile, the associated properties (may be inherited) are automatically removed. Nothing is done when the stereotype is modified through a plug-out.

By default the values of the stereotype properties for a stereotyped element are not shown in the diagrams, to show them through notes set the drawing setting show stereotype properties

A stereotypes defined in profile can be projected in stereotype known by a code generator by defining the projection through the generation settings, like for textual stereotypes.

Contrarily to some other modelers, you can modify profiles and stereotypes even when there are applied to elements, and stereotypes part of a profile are applicable immediately in the model where there are defined without asking for that explicitly.

Profile

A package-profile has some restrictions regarding to the standard packages :

To create a new profile, use the package menu entry New profile and enter its name or cancel its creation. Obviously you can also add profiles in a project by importing a project definition profiles, and you can also add a package then change its stereotype to profile.

When you edit a package-profile the dedicated tab profile is enabled :

When the stereotype of the package is profile, the tab Profile allows to set the meta model reference (by default http://schema.omg.org/spec/UML/2.1/uml.xml, specifies the value of the href produced in the XMI through an imported package) and meta class reference (specifies the value of the href produced in the XMI through an imported element). For a plug-out there are supported by the properties metamodelReference and metaclassreference.

When you delete a profile, Bouml asks for to propagate or not the deletion. If the propagation is done all the its stereotypes are also deleted and the corresponding properties removed from the stereotyped elements.

When a profile is defined in an other project and you re-import it to upgrade its use : delete the profile asking for to not propagate the deletion, then imports the new definition. In case used profiles are coming from several other projects, process step by step, before importing a given project defining a group of stereotypes delete these profiles and only them, then import the project. In case profiles are placed under a package grouping them, delete the profiles directly, don't delete them by deleting the container package because Bouml doesn't ask for to not propagate the deletion when the profiles are deleted indirectly.

Stereotype

A class-stereotype has some restrictions regarding to the standard classes:

Bouml doesn't manage OCL, so the constraints aren't checked, however you can attach plug-outs to a class-stereotype, refer to the corresponding dialogs described below.

To create a stereotype in a profile, choose the menu entry New stereotype proposed by the menu of a class view part of a package-profile.

When you edit a class-stereotype the dedicated tab stereotype is enabled :

The tab Stereotype allows to set who is extended, the elements on which the stereotype applies, and to set dedicated plug-outs :

Note : these plug-outs aren't called when the modifications are made by an other plug-out.

The extension is supported by an implicit attribute whose name is prefixed by base_, for instance base_Element when the stereotype extends http://schema.omg.org/spec/UML/2.1/uml.xml#Element

For a plug-out the list of elements on which the stereotype applies is supported by the property stereotypeApplyOn and the attached plug-outs are supported by the properties stereotypeSet and stereotypeCheck and their parameters by stereotypeSetParameters and stereotypeCheckParameters. The icon path is attached to the property stereotypeIconPath.

If the stereotype MyStereotype is defined in the profile MyProfile, an element stereotyped by MyStereotype has in fact the stereotype MyProfile:MyStereotype, and this couple of name must be unique without considering the case of the characters. You have to use the full stereotype name in the generation setting if you to project it in the target languages.

When you delete a profile (may be by changing its stereotype to not be profile), all its stereotypes are of course also deleted (except if the deletion is not propagated). When you rename a profile, the stereotypes of the elements are updated. When you move a class view out of a profile, the own stereotypes are first deleted and may be re-created after if the new package is a profile, the stereotyped elements are updated.

When you delete a stereotype (perhaps changing its stereotype to not be stereotype or moving its container class view), the stereotype and the associated properties are removed on the elements having this stereotype, the elements having a stereotype inheriting the deleted stereotype are also updated to remove the associated properties. When you rename a stereotype, the properties of the elements having its stereotype or having a stereotype inheriting it are also renamed. When you undelete a stereotype the consistency of the information related to the stereotypes is forced. Nothing is done when the stereotype is deleted through a plug-out except if this one calls UmlBasePackage::updateProfiles().

When you modify the inheritance between stereotypes, the properties of the elements are added/removed. When you undelete an inheritance between stereotypes the consistency of the information related to the stereotypes is forced. Nothing is done when the inheritance is modified through a plug-out except if this one calls UmlBasePackage::updateProfiles().

When you add/delete a stereotype attribute, the corresponding property of the elements are added/removed. When you undelete a stereotype attribute the consistency of the information related to the stereotypes is forced. Nothing is done when the modifications is done through a plug-out except if this one calls UmlBasePackage::updateProfiles().

When you load a model the consistency of the information related to the stereotypes is forced, adding or removing properties on the stereotyped elements. You can also ask for that phase, this is useful when you delete profiles without propagation and you want later to propagate the deletions, or when the modifications was made through a plug-out. You can also ask for to apply the plug-out dedicated to check the stereotyped elements.

Meta classes

A meta class is a class stereotyped metaclass

The path of a meta class (by default http://schema.omg.org/spec/UML/2.0/uml.xml or http://schema.omg.org/spec/UML/2.1/uml.xml depending on the XMI generation) is memorized through the property (tagged value) metaclassPath.

Previous : Deployment diagram

Next : C++ generator