Reuse Method Content: 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.

  1. Switch back to the Authoring perspective. authoring icon
  2.  

  3. Create a new Content Package under My Plug-in.

     

    new content package

     

    Name the new plug-in "Extends Test". Close the editor panel to save your changes.

  4.  

  5. Create a new Role under the Extends Test content package.

     

    new role added to Extends Test

  6.  

  7. Use these attributes for the new role:

     

  8.  

  9. Use the Variability Type menu to select Extends then click the Select... button. The Select Dialog: Roles window will appear.
  10.  

  11. Select the developer role and click OK. This will be the base role that our customizations extend.
  12.  

  13. Save the new role by closing the editor panel.
  14.  

  15. Update the variability configuration to include the new content package by doing the following:

     

    variability configuration panel

     

  16.  

  17. Now switch to Browsing perspective. browsing perspecitve button
  18.  

  19. In the Configuration View, select the 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.

 

Continue