Tutorial: Create Reusable Method Content
Exercise: Extend a Role
The goal of this exercise is to extend base method content associated with a Role by using Extends Variability.
Extends Variability works differently than Contributes variability in that the method content element that extends the base method element inherits the attributes of the extended base element.
- Switch to the Authoring perspective.
- Create a new Content Package in the My Plug-in plug-in
called "Extends Test".
- Create a new Role called "my_extends_ui_designer" with the presentation name "Extends RUP UI Designer".
- In the Variability Type select Extends and choose the base role rup_user_interface_designer.
- Add a Brief Description: "Extends Role Brief Description".
- Add a Main Description : "Extends Role Main Description".
- Save the new role by closing the Role Editor.
- Update the Variability Configuration to include the new content package.
- Open the Variability Configuration and expand My Plug-in > Method Content > Content Packages.
- Uncheck Contribution Test.
- Make sure Extends Test is checked.
This is done so there that are no conflicting extensions to the same method element.
- Close and save the changes to the configuration.
- Switch to Browsing perspective.
- In the Configuration View, select the Extends RUP UI Designer role in the
Uncategorized Roles folder under the Role Sets folder.
You will see in the HTML page that content entered in the extending role has been replaced,
whereas content not provided has been inherited from the base artifact.
Note that the extended role User-Interface Designer remains unchanged.
Continue