1 / 15

Analysis 2: Realizing Use Cases [A&N 12]

Analysis 2: Realizing Use Cases [A&N 12]. Recall, use case (your requirement). Online shop system. credit card company. Pay. customer. ID 1: Buy Desc : a customers pay the items she has in the basket. Primary actors : customer Secondary actors: credit card company

wiley
Download Presentation

Analysis 2: Realizing Use Cases [A&N 12]

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Analysis 2: Realizing Use Cases[A&N 12]

  2. Recall, use case (your requirement) Online shop system credit card company Pay customer ID 1: Buy Desc: a customers pay the items she has in the basket. Primary actors: customer Secondary actors: credit card company Pre-conditions: basket is not empty Main flow: The use-case starts when the customer requests it. The system determines the total price of the items in the basket. The system charges the price to the customer’s credit card. Post-conditions: the basket is empty

  3. Use case “realization” • Elements of this realization • Analysis class diagrams • Refined use case • Interaction models  sequence diagrams • Special requirements (that cannot be expressed with diagrams ) • “modeling interactions” : • top level  “system sequence diagram” • between your analysis classes, towards realizing a given use case

  4. Visually modeling use case flow with sequence diagram sd Buy : credit card company : System : customer buy () p = getTotalPrice() charge(p) • context • lifeline • activation region • The above is called “system SD”

  5. Analysis classes Suppose we come up with these analysis classes : owns consists of Customer Basket Item * 1 CreditCard 1 • determine total price • charge customer What are the responsibilities ?

  6. Analysis level sequence diagram owns consists of Customer charge(amount) Basket getTotalPrice() Item * 1 CreditCard sd Buy : credit card company b : Basket c : Customer : System : customer buy() getTotalPrice() totprice charge(totprice) charge(totprice) An SD models interactions between instances of some classes.  also a limitation... Still, you can express a lot.

  7. Realizing alternate flows Supposed the main flow of “Pay” use case is conditioned by a “valid” card; and else we have an alternate flow that simply doesn’t charge ... : credit card company : System b : Basket c: Customer u : CreditCard buy() getTotalPrice() totprice validate() validate() vld opt [vld=true] charge(totprice) charge(totprice) charge(totprice) reset()

  8. Other constructs a ref • So you can modularly structure your diagram • And you can leave holes to be refined later • See also ch. 13 Name.. b alt loop [condition] [condition-1 ] a a1 b b [condition-2] a2

  9. Lifeline constraint, state invariant b : Basket c : Customer : System buy() A getTotalPrice() getPrice() totprice { totprice > 0 } charge(totprice) reset() B empty { B – A < 3 min}

  10. Other constructs maybe more relevant for “Design” ... par a1 b a2 co-region [ ] c u critical v More constructs, see A&N

  11. Suppose in design we refine to: owns consists of Basket getTotalPrice() Item getPrice() Customer charge(amount) * 1 CreditCard validate() charge(amount) b : Basket : System getTotalPrice() for all item i in the basket : UML does give you a loop construct; but it can’t really express an iteration like this. As a side note, in this case it is a point of discussion whether you should put the iteration in a model of this level. i : Item getPrice() { p = total price } p

  12. Example : online auction • What are the actors ? • Use cases ? • Your analysis classes ? • User can bid on an auctioned item, until item’s deadline • 3 minutes “open” window, then 2 minutes “blocked” • User can buy-out the item

  13. Item minPrice buyOutPrice bid(p,user) buyout(user) highest bidder User charge(amount) 0..1 sd Bid :Item : System u: User alt [ item is blocking || deadline passed || soldout] bid(p) refuse [else] bid(p) critical bid(u,p) result result

  14. sd Buy out u:User i:Item : System u: User alt [ item is blocking || deadline passed || soldout] buyout() refuse [else] buyout() buyout(u) charge(i.buyoutPrice) ok

  15. Timing diagram t = 3min open : Item this basically is a time line blocking t <= 2 min bid(p) rejected : User

More Related