Exercise 4: Extending base method content associated with a role using Extends

The purpose of this exercise is to extend base method content via 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.

  1. Switch to the Authoring perspective.

  2. Create a new Content Package in the My Plugin Plug-in called Extends Test.

  3. Create a new Role : my_extends_ui_designer, with the presentation name, Extends RUP UI Designer.

  4. In the Variability Type select Extends and choose the base role: rup_user_interface_designer.

  5. Add a Brief Description: Extends Role Brief Description.

  6. Add a Main Description : Extends Role Main Description.

  7. Save the new role by closing the role editor.

  8. Update the Variability Configuration to include the new content package.
  9. • Open the Variability Configuration and expand My Plugin > 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.

  10. Switch to Browsing perspective.

  11. 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.