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 back to the Authoring perspective.
- Create a new content package under my_plug-in. Name the
new content package "extends_test". Close the editor panel and save your changes.
- Create a new role under the extends_test content package.
- Use these attributes for the new role:
- Name: my_extends_developer
- Presentation name: Extends OpenUP Developer
- Brief Description: My extended role brief description
- Main Description: My extended role description
- Use the Variability type menu to select Extends then
click Select . The Select Dialog: Roles window opens.
- Select the developer role and click OK. This will
be the base role that our customization extends.
- Save the new role by closing the editor panel.
- Update the configuration to include the new content package by
doing the following:
- Double-click the my.basic.configuration icon in the
Library view panel. The configuration editor panel opens.
- Click the Plug-in and Package Selection tab.
- Expand my_plug-in > Method Content > Content Packages.
- If they are checked, clear contribution_test and my_content_package. We do this to make sure that no contributions are coming from other
content packages.
- Make sure that extends_test is checked.
- Close and save the changes to the configuration.
- Switch to the Browsing perspective. Make sure that you are using my.basic.configuration.
- In the Configuration view, select Extends OpenUp Developer 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 Developer remains unchanged.