UML For E-Commerce - Cs.toronto.edu

Transcription

UML for e-CommerceDoug RosenbergICONIX Software Engineering, Inc.http://www.iconixsw.comCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com1

About this webinarbbbbbbBased on ICONIX UML for e-Commerce d on Internet Bookstore Example fromworkbook (Applying Use Case Driven .htmlPreview of public classeshttp://www.iconixsw.com/public courses.htmCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com2

UML for e-Commercebbbbbb2 or 3 day course targeted at internet/intranetdevelopmentStudents walk through the internet bookstoreexample.Hands on lab where the example is extended.This webinar will walk through 2 use casesComplete example available in the opyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com3

The WorkbookbbbbbbbCompanion work to Use Case Driven Object ModelingFirst book provides theoryWorkbook is focused on practiceInternet Bookstore example is dissected in great detail,starting from requirements through detailed designICONIX Process is explained in detail: domain models, usecases, robustness diagrams, sequence diagrams,detailed static models3 chapters on yright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com4

ICONIX ProcessbbbbbbbSynthesized from original Booch/Rumbaugh/Jacobsonmethods before UML existed (1992)Refined over 10 years, hundreds of training workshopsand productsMinimal yet sufficient subset of UML that is almostuniversally neededBook: Use Case Driven Object modelinghttp://www.iconixsw.com/UMLBook.htmlCDROM: Inside the ICONIX opyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com5

Main elements of the ICONIX Process,and where they came fromJacobsonJacobsonBoochRumbaughCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com6

Theory vs. practicebbbIn theory, there is no difference between theoryand practice, but in practice there is.In practice, there’s never enough time formodeling.The ICONIX Process is a STREAMLINED approach tosoftware development that helps you get fromuse cases to code quickly and efficiently, using aconcentrated subset of the UML and related toolsand techniques.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com7

Minimal, yet sufficientbbbbbbUML User Guide, Ch. 32, page 431 says 80% of modeling can be done with 20% of the UML.Which 20% was that again?We’re supposed to be “Use Case Driven” but.“How do we get from Use Cases to Code?”Smaller than RUP, bigger than XPAdd additional UML diagrams as neededCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com8

ICONIX Process:Do OOAD but Keep It SimpleCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com9

Let’s work backwards from codeLet’s assume that we’ve done a little prototyping, and startedto write some use cases.But code is our desired destination.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com10

Before we get to code.bWe need a complete set of classes, withaccompanying attributes and methods.bWe show this information on design-levelclass diagrams.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com11

Design-Level Class DiagramsOur design-level class diagrams serve as thestructure for our code.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com12

Before we have classes withattributes and methods, though bWe need to allocate behavior into our classesbWe have only enough information to make gooddecisions about which classes are responsible forwhich methods while we are drawing sequencediagrams.bSo, we need to draw a sequence diagram for eachuse case.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com13

Sequence DiagramsWe allocate methods to classes as we drawsequence diagrams.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com14

Before we do sequencediagrams, though.bWe need to have a good idea about what objectswill be performing in which use case, and whatfunctions the system will perform as a result of useractions.bWe get this information from robustnessdiagrams, the result of robustness analysis.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com15

Robustness Diagrams -- the missing link!We discover new objects, and add attributes toclasses, as we draw robustness diagrams.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com16

But we can’t draw robustnessdiagrams before.bWe describesystem usage in the context of the object model.bThis means that we don’t write abstract, vague use casesthat we can’t design from.bInstead, we need to write use case text that references thenames of objects in the problem domain.bWe also reference the names of "boundary objects" in theuse case text.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com17

First, though.bWe need to identify the main abstractions that arepresent in the problem domain.bIn other words, we need a domain model.bWe show our domain model on class diagrams.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com18

Domain ModelThe domain model completes the picture.Note the domain model is done before we write use case textCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com19

Refining our class diagramsbWe'll refine our (static) analysis level classdiagrams (our domain model) continuously as weexplore the dynamic behavior of the system in moreand more detail during analysis and design.bThis will ultimately result in our design-level classdiagrams, which we can code from.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com20

The ICONIX ProcessCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com21

The Internet Bookstore ExamplebbbbbDomain ModelUse Case Model2 use cases: Login, Edit Shopping CartRobustness and Sequence Diagrams for each use caseShow common errors (Wrong way / Right way)Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com22

RequirementsbThe bookstore shall accept orders over the Internet.bThe bookstore shall maintain a list of accounts for up to 1,000,000 customers.bThe bookstore shall provide password protection for all accounts.bThe bookstore shall provide the ability to search the master book catalog.bThe bookstore shall provide a number of search methods on that catalog, including search by author,search by title, search by ISBN number, and search by keyword.bThe bookstore shall provide a secure means of allowing customers to pay by credit card.bThe bookstore shall provide a secure means of allowing customers to pay via purchase order.bThe bookstore shall provide a special kind of account that is preauthorized to pay via purchase order.bThe bookstore shall provide electronic links between the Web and database and the shipping fulfillmentsystem.bThe bookstore shall provide electronic links between the Web and database and the inventory managementsystem.bThe bookstore shall maintain reviews of books, and allow anyone to upload review comments.bThe bookstore shall maintain ratings on books, based on customer inputs.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com23

Domain ModelCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com24

Use Case ModelCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com25

Login: bad use case textb(Exercise 1) The Customer enters his or her user ID and password, and then clicks the Log In button.The system returns the Customer to the Home Page.b(Exercise 2) Name: Log InbGoal: To log a customer into the system.bPrecondition: The Customer is not already logged into the system.bBasic Course: The Customer enters his or her user ID and password, and then clicks the Log Inbutton .bAlternate Courses: bPostcondition: The Customer is logged into the system.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com26

Login: good use case textb(Exercise 1) Basic Course: The Customer enters his or her user ID and password, and then clicks theLog In button. The system validates the login information against the persistent Account data, andthen returns the Customer to the Home Page.b(Exercise 2) Basic Course: The Customer enters his or her user ID and password, and then clicks theLog In button .Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com27

Login: bad robustness diagramCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com28

Login: good robustness diagramCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com29

Login: bad sequence diagramCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com30

Login: good sequence diagramCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com31

High degree of traceabilitybbbCourses of action describe what goes on in a use case(normally and in exceptional cases)Robustness diagrams bridge the “what/how” gapSequence diagrams are done for each use caseCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com32

Edit Shopping Cart use case textbBasic Course: On the Shopping Cart Page, the Customer modifies thequantity of an Item in the Shopping Cart, and then presses the Updatebutton. The system stores the new quantity, and then computes anddisplays the new cost for that Item .bAlternate Course: If the Customer changes the quantity of the Item to 0,the system deletes that Item from the Shopping Cart.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com33

Robustness diagrams bridge the“what/how” gapbMost current UML texts do not address crossing this what/how gap.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com34

Edit shopping cart robustnessdiagramCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com35

A closer look inside RobustnessAnalysisCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com36

Use the robustness diagram to getthe sequence diagram startedCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com37

Edit shopping cart sequencediagramCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com38

Use the Sequence Diagram toAllocate Behaviorb Which class does an operation belong in?Halbert and O’Brien criteria:b Reusability: does it make this class more general?b Applicability: does it fit? Is it relevant?b Complexity: is it easier to build it here or elsewhere?b Implementation knowledge: does it rely on internaldetails?Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com39

Update your static model, againCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com40

What is a “quality” class?bbbbbCoupling: should be loosely coupled with otherclassesCohesion: should be highly cohesiveSufficiency: does it do enough?Completeness: does it cover all the relevant aabstractions?Primitiveness: stick to basic operationsCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com41

Detailed Static Model (1 of 3)Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com42

Detailed Static Model (2 of 3)Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com43

Detailed Static Model (3 of 3)Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com44

Code and TestbbbComponent Diagrams show packaging of classesinto distributable unitsUsage scenarios (use cases) become testscenarios (test cases)We can link requirements, test cases and othersoftware quality assurance (SQA) information tothese models and follow them through thedesign.Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com45

Key features of the ICONIX ProcessAvoidance of analysis paralysisb Streamlined usage of the UMLb Minimalist yet sufficientb High degree of traceabilityb Based on fundamental OOAD questionsb Work from the outside inb Work from the inside outbCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com46

Based on fundamental OOAD questionsbbbbbbWhat are the users doing? (Jacobson)What are the objects in the real world? (Rumbaugh)What objects are needed for each use case? (Jacobson)How do the objects collaborate with each other?(Jacobson and Booch)How will we implement real-time control? (state models)How are we really going to build this system? (Booch)Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com47

Work from the outside inObjectory and the ICONIX Process areuse-case driven (outside-in)By keeping use cases as the primaryunit of system decomposition, we stayuser-focusedBy using prototyping in conjunctionwith use cases, we stay user-focusedCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com48

Work from the inside outbbbbOMT was object driven (inside-out)OMT models real-world(domain)Some upfront thought about theproblem domain makes everythingeasierReuse across systems comes fromthe domain modelCopyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com49

For further informationbbbbbbbbbbEMAIL: blic courses.htmPhone: 310-458-0092FAX: 310-396-3454If interested in public class in SF Dec 10, 11 contact Jon Graffjon@iconixsw.com 310-458-0092Copyright 2001 ICONIX SoftwareEngineering, Inc. www.iconixsw.com50

UML for e-Commerce b2 or 3 day course targeted at internet/intranet development bStudents walk through the internet bookstore example. . b The bookstore shall provide the ability to search the master book catalog. b The bookstore shall provide a number of search methods on that catalog, i