Sept Ron McFadyen1 Include Relationship UC1:Process Sale … Main Success Scenario … 7. Customer pays and System handles payment. … Extensions or alternate flows: 7a. Paying by cash … 7b. Paying by credit: include Handle Credit Payment 7c. Paying by check: include Handle Check Payment
Sept Ron McFadyen2 Include Relationship In the UML diagram Process Sale Handle Check Payment Handle Credit Payment > Process Sale has a dependency on Handle Check Payment, and another dependency on Handle Credit Payment The dashed lines and the stick arrowhead are the correct way to depict dependencies
Sept Ron McFadyen3 Include Relationship Suppose a Purchase order system has two use cases Place Order and Track Order and both contain customer validation. Customer validation could be factored out, resulting in: Validate Customer > Track Order Place Order Customer
Sept Ron McFadyen4 Include Relationship Suppose ATM is a base use case and contains: 1.Show advertisement of the day 2.Include identify customer 3.Include validate account 4.… Validate Account > Identify customer Customer ATM session
Sept Ron McFadyen5 Extend Relationship
Sept Ron McFadyen6 Extend Relationship The extend relationship is typically used for optional behaviour Extend is used to separate optional from mandatory behaviour; extend is used to distinguish variants in behaviour Under a specified condition the base use case is extended with the behaviour specified in the addition use case. We say the addition use case is dependent on the base use case (note the directed line in the drawing)
Sept Ron McFadyen7 Extend Relationship Process Sale collects the payment from the customer. Suppose payment via a gift certificate is considered an exceptional case. See Figure 25.3 > Handle Gift Certificate Payment Cashier Payment, if the Customer presents a gift certificate Process Sale Extension Points: Payment
Sept Ron McFadyen8 Extend Relationship Process Sale declares/states “Payment” is an extension point, but Process Sale does not know anything else: the condition, the name of the other addition use case. (see page 389) > Handle Gift Certificate Payment Cashier Payment, if the Customer presents a gift certificate Process Sale Extension Points: Payment