Better Software - March 2009 - (Page 45) To identify join points for a use case, we take each crosscutting concern listed in the RCT as applicable to that use case and, by going through the use case specification, we decide where a given crosscutting concern can affect the use case context. In our RCT example shown in figure 2, the first applicable crosscutting concern is ET-Entitlements. Now, we examine the use case specification shown in figure 3 and find that the first use case precondition relates to user privilege. Hence, the ET concern affects this precondition that becomes a join point. The next applicable concern is ST-Status, which also controls the entire use case context and affects the second precondition that becomes a join point as well. One more example is the crosscutting concern FV-Field Validation. We find that step 7 in the use case scenario shown in figure 3 performs validation of the reservation’s data. Hence, this step becomes another join point as it is impacted by the FV concern. We continue this analysis for all other applicable crosscutting concerns until we find all of their respective join points. It is possible that the same join point can be impacted by multiple crosscutting concerns (step 7 is an example). It is also possible that the same type of crosscutting concerns can have multiple join points in the same use case scenario (e.g., the crosscutting concern CN-Connectivity affects steps 2 and 7). Composition Modeling Using UML Composition of crosscutting concerns with a given core feature, whether it is documented as a user story or use case, can be modeled with UML and using diagrams similar to conventional use case diagrams (see figure 4 below). To produce such a diagram, we follow a simple convention: • A crosscutting concern is shown as an ellipse containing the type of the crosscutting concern. • Each composition is represented by using the relationship keyword (e.g., < >, < >, < >) that reflects the composition rule type. • Association notations: – When a crosscutting concern is composed with a core feature using the wrap rule, we represent it in the diagram as a dashed arrow pointing from the crosscutting concern to the affected core feature and indicating that the crosscutting concern imposes a constraint and has complete control over the core feature context. – When a crosscutting concern is composed with a core feature using the override or overlap rules, we represent it in the diagram as a dashed arrow pointing from the core feature to the crosscutting concern and indicating that the crosscutting concern is invoked in the context of the affected core feature. 2. select coMPosition rules Once we have identified a join point, we can analyze how the given crosscutting concern affects the use case and decide what composition rule should be applied. This decision is based on the composition rule guidelines discussed previously. Following these guidelines, we select the wrap composition rule for the ET and ST concerns as they impose constraints on the use case context. We select the override rule for the FV, DDV, CC, and CN concerns, because if any of these validations fails it interrupts the use case flow and changes the outcome. Correspondingly, we select the overlap rule for the SI concern, as it adds detail to the use case outcome related to the data exchange with the external systems. A complete view of the composition results can be presented as a UML diagram Figure 4: Composition modeling using UML as shown in the side bar “Composition Modeling Using UML.” When we have identified both a join point and a composition rule for a given crosscutting concern, we then document its impact by including a composition pointer in the join point. Each composition pointer is composed of the crosscutting concern type and its composition rule—for example, ET-wrap1 or FVoverride2—as shown in figure 3. A composition pointer serves a dual purpose: • It indicates which crosscutting concern impacts the given join point and how, so we can clearly www.StickyMinds.com see what else we need to consider at this point in the use case scenario. • It is used as a hyperlink to navigate quickly to details of a given crosscutting concern realization documented and bookmarked in a separate appendix of a use case specification, as shown in figure 3. This way, even if we include new steps or delete some steps in the use case scenario, the existing references (i.e., hyperlinks) to realizations of crosscutting concerns still remain valid. MARCH 2009 BETTER SOFTWARE 45 http://www.StickyMinds.com
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.