OOA and OOD (revisited) • • • • • • • • Online Bookshop example Requirements Use Cases Class diagrams Identifying attributes Sequence diagrams Identifying methods Packages 1 Requirements • Online bookshop – You are supposed to build the software for an online bookshop that sells books, CDs and software; each client can login into the system, browse the items from the bookshop, add items to his own shopping cart. The customer can create an order with the items from his shopping cart. The items from the order will be sent to his mailing address, while the bill is sent to the billing address. – You don’t have to worry about the GUI, another team is working on that. 2 Use Cases • Actors – Customer – Bookshop staff • Use-cases – Customer registers details – Customer browses and orders items – Bookshop staff ships to customer – Customer updates details – Bookshop staff updates items 3 Use Case Diagram 4 Identify Classes 5 Identify Inheritance Relationships Among Classes Inheritance – – – – Book “is-a” Item MusicCD “is-a” Item Software “is-a” Item BillingAddress “is-a” Address – ShippingAddress “isa” Address 6 Isolated class design - attributes • • • artist version • • name customerID password Address – – – – – – author edition isbn Software – • • Order salesTax shippingFee total Customer – – – MusicCD – • title publisher yearPublished price • Book – – – • name Item – – – – • name BookshopStaff – • – – – – Bookshop – ShoppingCart streetNumber street city state country postCode BillingAddress ShippingAddress ItemOrder – – item quantity 7 Attributes from Aggregation and Composition • Bookshop – – – – • Customer – – – – • Items BookshopStaff Customers Orders Shopping cart Order BillingAddress ShippingAddress Shopping cart – ItemOrders (composition) • Order – Customer – ItemOrders (composition) 8 Class diagram with attributes 9 Sequence Diagram 10 Identify Methods of Classes – Class Diagram 11 Packages 12
© Copyright 2024 ExpyDoc