| <?xml version="1.0" encoding="UTF-8"?> |
| <org.eclipse.epf.uma:ContentDescription xmi:version="2.0" |
| xmlns:xmi="http://www.omg.org/XMI" xmlns:org.eclipse.epf.uma="http://www.eclipse.org/epf/uma/1.0.5/uma.ecore" |
| xmlns:epf="http://www.eclipse.org/epf" epf:version="1.5.0" xmlns:rmc="http://www.ibm.com/rmc" |
| rmc:version="7.5.0" xmi:id="-V_0kmI76XRz-UHHq2rP2Ag" |
| name="using_method_content_variability,_8YIMYCNQEdycLddDalDmbA" guid="-V_0kmI76XRz-UHHq2rP2Ag" |
| changeDate="2008-10-17T01:48:42.829-0700" version="7.1.0"> |
| <mainDescription><p>
 |
| This guideline explains how to utilize method content variability to modify an existing element without directly
 |
| changing the original element's base definition, or to create a new element based on an existing element. Changes are
 |
| defined in a separate content package or plug-in, and the original plug-in is kept intact. Thus, it allows you to
 |
| change method elements by simply changing a configuration (in other words, changing what plug-ins and packages are
 |
| included in the configuration).
 |
| </p>
 |
| <p>
 |
| Variability involves textual attributes and relationships.&nbsp; In other words you can use variability to add, delete
 |
| change, or reuse&nbsp;both text and relationships.&nbsp;
 |
| </p>
 |
| <p>
 |
| Variability is defined between two elements of the same type:
 |
| </p>
 |
| <ul>
 |
| <li>
 |
| Base element: The target of the variability; the element being changed (or used as a base for new element)
 |
| </li>
 |
| <li>
 |
| Variability element: The element containing the changes (or new content or relationships) to be combined with the
 |
| base
 |
| </li>
 |
| </ul>
 |
| <p>
 |
| The base element is never changed directly. All changes (or new content) is defined in the variability element. The
 |
| variability element specifies which element is the base.
 |
| </p>
 |
| <p>
 |
| As shown in Figure 1, when both the base element and the varaibility element are inlcluded in a configuration, the
 |
| configuration "resolves" the variability to produce the result, where that result depends on what variability was used.
 |
| </p>
 |
| <p>
 |
| <strong>Figure 1. Method content variability elements</strong><br />
 |
| </p><br />
 |
| <p>
 |
| <img alt="variability_elements" src="./resources/variability.gif" border="0" />&nbsp;
 |
| </p>
 |
| <p>
 |
| There are different types of variability, each with their own characteristics, rules, pros and cons. Table 1 provides a
 |
| summary of the different types of variability and when you might want to use them.<br />
 |
| <br />
 |
| </p>
 |
| <table title="Method Content Variability Summary" cellspacing="0" cellpadding="2" width="85%"
 |
| summary="summary of different types of method content variability" border="1">
 |
| <caption>
 |
| <strong>Table 1. Method Content Variability Summary</strong>
 |
| </caption>
 |
| <tbody>
 |
| <tr>
 |
| <td>
 |
| <strong>Variability Type</strong>
 |
| </td>
 |
| <td>
 |
| <strong>Result</strong>
 |
| </td>
 |
| <td>
 |
| <strong>Possible Uses</strong>
 |
| </td>
 |
| </tr>
 |
| <tr>
 |
| <td>
 |
| Contributes
 |
| </td>
 |
| <td>
 |
| <p>
 |
| Contributing element adds to the base element<br />
 |
| (result = base element plus contributed characteristics)
 |
| </p>
 |
| <ul>
 |
| <li>
 |
| Contributing (variability) element adds to the base element.
 |
| </li>
 |
| <li>
 |
| The base appears in the published Web site, but the contributing element does not.
 |
| </li>
 |
| <li>
 |
| Incoming and outgoing relationships from the contributing element are added to the base<br />
 |
| Exception: If the relationship is a "to one" relationship (for example, a task has at most one
 |
| primary performing role) then the relationship in the contributor is ignored if the base already
 |
| has one.
 |
| </li>
 |
| <li>
 |
| Text from the contributing element is appended to corresponding base sections.
 |
| </li>
 |
| <li>
 |
| A base element can have more then one contributor.
 |
| </li>
 |
| <li>
 |
| Contributes works transitively (a contributing element contributes its own contributors).
 |
| </li>
 |
| </ul>
 |
| </td>
 |
| <td>
 |
| <ul>
 |
| <li>
 |
| Add guidance to an existing element
 |
| </li>
 |
| <li>
 |
| Add steps to an existing task
 |
| </li>
 |
| <li>
 |
| Add responsibility for a work product to a role
 |
| </li>
 |
| <li>
 |
| Add a primary performing role to a task
 |
| </li>
 |
| <li>
 |
| Add a work product to a task (as an input or output work product)
 |
| </li>
 |
| <li>
 |
| Add text to existing elements
 |
| </li>
 |
| <li>
 |
| Adding method elements to existing categories<br />
 |
| <br />
 |
| </li>
 |
| </ul>
 |
| </td>
 |
| </tr>
 |
| <tr>
 |
| <td>
 |
| Replaces
 |
| </td>
 |
| <td>
 |
| <p>
 |
| Replacing element replaces parts of the base element (incoming relationships remain)<br />
 |
| (result = new element, no base element)
 |
| </p>
 |
| <ul>
 |
| <li>
 |
| Replacing (variability)&nbsp;element replaces parts of the base element.
 |
| </li>
 |
| <li>
 |
| The replacing element&nbsp;appears in the published Web site but the base element does not.
 |
| </li>
 |
| <li>
 |
| Outgoing relationships in the replacing element are maintained, and the base's are ignored.
 |
| </li>
 |
| <li>
 |
| Incoming relationships to the base are maintained and added to the replacing element.<br />
 |
| Exception: If the replacing element has an incoming to-one relationship (for example, a replacing a
 |
| role that includes a task performs the role relationship),&nbsp;the replacing element&nbsp;replaces
 |
| that relationship in the&nbsp;base element.
 |
| </li>
 |
| <li>
 |
| Text in the replacing element is left maintained, the base's text is ignored.
 |
| </li>
 |
| <li>
 |
| A base element can only be replaced by one replacing element at a time. If two elements replace the
 |
| same base element,&nbsp;only one can be used for interpretation (the plug-in containing one of the
 |
| replacing elements needs to be removed from the configuration or no replacement will take place).
 |
| </li>
 |
| <li>
 |
| Replacement works transitively (if a replacing element is replaced itself, then&nbsp;the final
 |
| replacing element will prevail).
 |
| </li>
 |
| </ul>
 |
| </td>
 |
| <td>
 |
| <ul>
 |
| <li>
 |
| Replace an existing method content element with another method content element
 |
| </li>
 |
| </ul>
 |
| </td>
 |
| </tr>
 |
| <tr>
 |
| <td>
 |
| Extends
 |
| </td>
 |
| <td>
 |
| <p>
 |
| Extending element inherits characteristics of the base element<br />
 |
| (result = base element + new element)
 |
| </p>
 |
| <ul>
 |
| <li>
 |
| Extending (variability) element inherits characteristics of the base element. The base element is
 |
| unchanged.
 |
| </li>
 |
| <li>
 |
| Both the extending element&nbsp;and the base appear in the published Web site.
 |
| </li>
 |
| <li>
 |
| Outgoing relationships from the base are added to the extending element.
 |
| </li>
 |
| <li>
 |
| Incoming relationships in the extending element&nbsp;are maintained, and the base's are ignored.
 |
| </li>
 |
| <li>
 |
| Text is included in the extending element from the base element if the extending element&nbsp;did
 |
| not include any text for the given section.
 |
| </li>
 |
| <li>
 |
| Extends works transitively (if an extending element is extended itself the second extension
 |
| inherits from its direct and indirect base elements).
 |
| </li>
 |
| </ul>
 |
| </td>
 |
| <td>
 |
| <ul>
 |
| <li>
 |
| Define a new element that looks just like an existing element, with some modifications (in other
 |
| words, define a variant or a specialization of an existing element)
 |
| </li>
 |
| <li>
 |
| Extends is not used to modify an existing element
 |
| </li>
 |
| </ul>
 |
| </td>
 |
| </tr>
 |
| <tr>
 |
| <td>
 |
| Extends-Replaces
 |
| </td>
 |
| <td>
 |
| <p>
 |
| Replacing element replaces only values that have been redefined in the replacer<br />
 |
| (result = new element, no base element)
 |
| </p>
 |
| <ul>
 |
| <li>
 |
| Combines the effects of extends and replaces variability, allowing you to selectively replace
 |
| specific attributes and relationships of the base element.
 |
| </li>
 |
| <li>
 |
| Extending-replacing (variability) element replaces values in the base element that have been
 |
| redefined in the&nbsp;extending-replacing element . All other values of the base element are
 |
| unaffected.
 |
| </li>
 |
| <li>
 |
| Both the extending-replacing element&nbsp;and the base appear in the published Web
 |
| site.&nbsp;&nbsp;
 |
| </li>
 |
| </ul>
 |
| </td>
 |
| <td>
 |
| <ul>
 |
| <li>
 |
| Rename an existing element
 |
| </li>
 |
| <li>
 |
| Replace a specific textual attribute of a method element
 |
| </li>
 |
| <li>
 |
| Replace the outgoing relationships of an existing method element
 |
| </li>
 |
| <li>
 |
| Replace the incoming relationships of an existing method element
 |
| </li>
 |
| </ul>
 |
| </td>
 |
| </tr>
 |
| </tbody>
 |
| </table>
 |
| <p>
 |
| For detailed information on how the different kinds of method content variability affect the different method element
 |
| relationships, see the attached spreadsheet (<a href="./resources/Variability%20Cheat%20Sheet.xls"
 |
| target="_blank">Variability Cheat Sheet.xls</a>).
 |
| </p>
 |
| <h3>
 |
| Order of Evaluation
 |
| </h3>
 |
| <p>
 |
| Contribution precedes replacement (the contributes relationship is resolved first, followed by the replaces
 |
| relationship). The evaluation of contribution and replacement is performed top-down in the specialization hierarchy.
 |
| </p>
 |
| <h3>
 |
| Handy Tricks
 |
| </h3>
 |
| <p>
 |
| If you ever find that you want to create an element that looks just like an existing element, but includes some
 |
| additional content, you can use a combination of extends and contributes to achieve the desired result.&nbsp; To do
 |
| this, perform the following steps:
 |
| </p>
 |
| <ol>
 |
| <li>
 |
| Define a method element that that extends the original base element. This results in a new element that looks just
 |
| like the original element.
 |
| </li>
 |
| <li>
 |
| Define another method element that contributes to the extending element and add the desired content. This results
 |
| in adding the new content to the new element that already includes the original content.
 |
| </li>
 |
| </ol>
 |
| <p>
 |
| The net resutl:&nbsp;A new element that includes the original content plus the new content.
 |
| </p></mainDescription> |
| </org.eclipse.epf.uma:ContentDescription> |