copyright 2001 iconix software engineering, inc. 1 uml for e-commerce doug rosenberg iconix...
TRANSCRIPT
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
1
UML for e-CommerceUML for e-Commerce
Doug RosenbergDoug Rosenberg
ICONIX Software Engineering, Inc.ICONIX Software Engineering, Inc.
http://www.iconixsw.comhttp://www.iconixsw.com
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
2
About this webinarAbout this webinar
Based on ICONIX UML for e-Commerce classBased on ICONIX UML for e-Commerce class http://www.iconixsw.com/UMLecommerce.htmlhttp://www.iconixsw.com/UMLecommerce.html Based on Internet Bookstore Example from Based on Internet Bookstore Example from
workbook (Applying Use Case Driven Object workbook (Applying Use Case Driven Object Modeling)Modeling)
http://www.iconixsw.com/UMLworkbook.htmlhttp://www.iconixsw.com/UMLworkbook.html Preview of public classesPreview of public classes http://www.iconixsw.com/public_courses.htmhttp://www.iconixsw.com/public_courses.htm
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
3
UML for e-CommerceUML for e-Commerce
2 or 3 day course targeted at internet/intranet 2 or 3 day course targeted at internet/intranet developmentdevelopment
Students walk through the internet bookstore Students walk through the internet bookstore example.example.
Hands on lab where the example is extended.Hands on lab where the example is extended. This webinar will walk through 2 use casesThis webinar will walk through 2 use cases Complete example available in the workbookComplete example available in the workbook http://www.iconixsw.com/UMLecommerce.htmlhttp://www.iconixsw.com/UMLecommerce.html
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
4
The WorkbookThe Workbook
Companion work to Use Case Driven Object Companion work to Use Case Driven Object ModelingModeling
First book provides theoryFirst book provides theory Workbook is focused on practiceWorkbook is focused on practice Internet Bookstore example is dissected in great Internet Bookstore example is dissected in great
detail, starting from requirements through detail, starting from requirements through detailed designdetailed design
ICONIX Process is explained in detail: domain ICONIX Process is explained in detail: domain models, use cases, robustness diagrams, models, use cases, robustness diagrams, sequence diagrams, detailed static modelssequence diagrams, detailed static models
3 chapters on reviews3 chapters on reviews http://www.iconixsw.com/UMLworkbook.htmlhttp://www.iconixsw.com/UMLworkbook.html
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
5
ICONIX ProcessICONIX Process
Synthesized from original Synthesized from original Booch/Rumbaugh/Jacobson methods before Booch/Rumbaugh/Jacobson methods before UML existed (1992)UML existed (1992)
Refined over 10 years, hundreds of training Refined over 10 years, hundreds of training workshops and productsworkshops and products
Minimal yet sufficient subset of UML that is Minimal yet sufficient subset of UML that is almost universally needed almost universally needed
Book: Use Case Driven Object modelingBook: Use Case Driven Object modeling http://www.iconixsw.com/UMLBook.htmlhttp://www.iconixsw.com/UMLBook.html CDROM: Inside the ICONIX ProcessCDROM: Inside the ICONIX Process http://www.iconixsw.com/ICONIXProcess.htmlhttp://www.iconixsw.com/ICONIXProcess.html
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
6
Main elements of the ICONIX Main elements of the ICONIX Process, and where they came Process, and where they came fromfrom
Jacobson Booch
Jacobson
Rumbaugh
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
7
Theory vs. practiceTheory vs. practice
In theory, there is no difference between In theory, there is no difference between theory and practice, but in practice there theory and practice, but in practice there is.is.
In practice, there’s never enough time for In practice, there’s never enough time for modeling.modeling.
The ICONIX Process is a STREAMLINED The ICONIX Process is a STREAMLINED approach to software development that approach to software development that helps you get from use cases to code helps you get from use cases to code quickly and efficiently, using a quickly and efficiently, using a concentrated subset of the UML and concentrated subset of the UML and related tools and techniques.related tools and techniques.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
8
Minimal, yet sufficientMinimal, yet sufficient
UML User Guide, Ch. 32, page 431 says…UML User Guide, Ch. 32, page 431 says… 80% of modeling can be done with 20% of 80% of modeling can be done with 20% of
the UML.the UML. Which 20% was that again?Which 20% was that again? We’re supposed to be “Use Case Driven” We’re supposed to be “Use Case Driven”
but...but... ““How do we get from Use Cases to How do we get from Use Cases to
Code???”Code???” Smaller than RUP, bigger than XPSmaller than RUP, bigger than XP Add additional UML diagrams as neededAdd additional UML diagrams as needed
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
9
ICONIX Process:ICONIX Process:Do OOAD but Keep It Do OOAD but Keep It SimpleSimple
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
10
Let’s work backwards from Let’s work backwards from codecode
Let’s assume that we’ve done a little Let’s assume that we’ve done a little prototyping, and started to write some use prototyping, and started to write some use cases.cases.
But code is our desired destination.But code is our desired destination.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
11
Before we get to code...Before we get to code...
We need a complete set of classes, We need a complete set of classes, with accompanying attributes and with accompanying attributes and methods.methods.
We show this information on We show this information on design-level class diagrams.design-level class diagrams.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
12
Design-Level Class Design-Level Class DiagramsDiagrams
Our design-level class diagrams serve as Our design-level class diagrams serve as the structure for our code.the structure for our code.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
13
Before we have classes Before we have classes with attributes and with attributes and methods, though…methods, though…
We need to We need to allocate behaviorallocate behavior into our into our classesclasses
We have only enough information to We have only enough information to make good decisions about which classes make good decisions about which classes are responsible for which methods while are responsible for which methods while we are drawing sequence diagrams.we are drawing sequence diagrams.
So, we need to draw a sequence So, we need to draw a sequence diagram for each use case.diagram for each use case.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
14
Sequence DiagramsSequence Diagrams
We We allocate methods to classesallocate methods to classes as we as we draw sequence diagrams.draw sequence diagrams.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
15
Before we do sequence Before we do sequence diagrams, though...diagrams, though...
We need to have a good idea about what We need to have a good idea about what objects will be performing in which use objects will be performing in which use case, and what functions the system will case, and what functions the system will perform as a result of user actions.perform as a result of user actions.
We get this information from robustness We get this information from robustness diagrams, the result of robustness diagrams, the result of robustness analysis.analysis.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
16
Robustness Diagrams -- the Robustness Diagrams -- the missing link!missing link!
We discover new objects, and add We discover new objects, and add attributes to classes, as we draw attributes to classes, as we draw robustness diagrams.robustness diagrams.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
17
But we can’t draw But we can’t draw robustness diagrams robustness diagrams before...before...
We describe We describe system usagesystem usage in the in the context of the object modelcontext of the object model..
This means that we don’t write abstract, vague This means that we don’t write abstract, vague use cases that we can’t design from.use cases that we can’t design from.
Instead, we need to Instead, we need to write use case text that write use case text that references the names of objects in the problem references the names of objects in the problem domaindomain..
We also reference the names of "boundary We also reference the names of "boundary objects" in the use case text.objects" in the use case text.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
18
First, though...First, though...
We need to identify the main We need to identify the main abstractions that are present in the abstractions that are present in the problem domain.problem domain.
In other words, In other words, we need a domain we need a domain modelmodel..
We show our domain model on class We show our domain model on class diagrams.diagrams.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
19
Domain ModelDomain Model
ain model completes the picture.Note the domain model is done before we write use case text
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
20
Refining our class Refining our class diagramsdiagrams
We'll refine our (static) analysis level We'll refine our (static) analysis level class diagrams (our domain model) class diagrams (our domain model) continuously as we explore the dynamic continuously as we explore the dynamic behavior of the system in more and more behavior of the system in more and more detail during analysis and design.detail during analysis and design.
This will ultimately result in our design-This will ultimately result in our design-level class diagrams, which we can code level class diagrams, which we can code from.from.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
21
The ICONIX ProcessThe ICONIX Process
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
22
The Internet Bookstore The Internet Bookstore ExampleExample
Domain ModelDomain Model Use Case ModelUse Case Model 2 use cases: Login, Edit Shopping Cart2 use cases: Login, Edit Shopping Cart Robustness and Sequence Diagrams for each Robustness and Sequence Diagrams for each
use caseuse case Show common errors (Wrong way / Right way)Show common errors (Wrong way / Right way)
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
23
RequirementsRequirements
The bookstore shall accept orders over the Internet. The bookstore shall maintain a list of accounts for up to 1,000,000 customers. The bookstore shall provide password protection for all accounts. The bookstore shall provide the ability to search the master book catalog. The 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. The bookstore shall provide a secure means of allowing customers to pay by credit card. The bookstore shall provide a secure means of allowing customers to pay via purchase order. The bookstore shall provide a special kind of account that is preauthorized to pay via purchase order. The bookstore shall provide electronic links between the Web and database and the shipping fulfillment
system. The bookstore shall provide electronic links between the Web and database and the inventory
management system. The bookstore shall maintain reviews of books, and allow anyone to upload review comments. The bookstore shall maintain ratings on books, based on customer inputs.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
24
Domain ModelDomain Model
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
25
Use Case ModelUse Case Model
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
26
Login: bad use case textLogin: bad use case text (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.
(Exercise 2) Name: Log In
Goal: To log a customer into the system.
Precondition: The Customer is not already logged into the system.
Basic Course: The Customer enters his or her user ID and password, and then clicks the Log In button….
Alternate Courses: …
Postcondition: The Customer is logged into the system.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
27
Login: good use case textLogin: good use case text
(Exercise 1) Basic Course: The Customer enters his or her user ID and password, and then clicks the Log In button. The system validates the login information against the persistent Account data, and then returns the Customer to the Home Page.
(Exercise 2) Basic Course: The Customer enters his or her user ID and password, and then clicks the Log In button….
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
28
Login: bad robustness Login: bad robustness diagramdiagram
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
29
Login: good robustness Login: good robustness diagramdiagram
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
30
Login: bad sequence Login: bad sequence diagramdiagram
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
31
Login: good sequence Login: good sequence diagramdiagram
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
32
High degree of traceabilityHigh degree of traceability
Courses of action describe what goes on in a Courses of action describe what goes on in a use case (normally and in exceptional cases)use case (normally and in exceptional cases)
Robustness diagrams bridge the “what/how” Robustness diagrams bridge the “what/how” gapgap
Sequence diagrams are done for each use Sequence diagrams are done for each use casecase
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
33
Edit Shopping Cart use Edit Shopping Cart use case textcase text
Basic Course: On the Shopping Cart Page, the Customer modifies the quantity of an Item in the Shopping Cart, and then presses the Update button. The system stores the new quantity, and then computes and displays the new cost for that Item….
Alternate Course: If the Customer changes the quantity of the Item to 0, the system deletes that Item from the Shopping Cart.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
34
Robustness diagrams bridge Robustness diagrams bridge the “what/how” gapthe “what/how” gap
Most current UML texts do not address crossing this what/how Most current UML texts do not address crossing this what/how gap.gap.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
35
Edit shopping cart Edit shopping cart robustness diagramrobustness diagram
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
36
A closer look inside A closer look inside Robustness AnalysisRobustness Analysis
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
37
Use the robustness diagram Use the robustness diagram to get the sequence diagram to get the sequence diagram startedstarted
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
38
Edit shopping cart Edit shopping cart sequence diagramsequence diagram
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
39
Use the Sequence Use the Sequence Diagram to Allocate Diagram to Allocate BehaviorBehavior
Which class does an operation Which class does an operation belong in?belong in?
Halbert and O’Brien criteria:Halbert and O’Brien criteria: Reusability: does it make this class more Reusability: does it make this class more
general?general? Applicability: does it fit? Is it relevant?Applicability: does it fit? Is it relevant? Complexity: is it easier to build it here or Complexity: is it easier to build it here or
elsewhere?elsewhere? Implementation knowledge: does it rely on Implementation knowledge: does it rely on
internal details?internal details?
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
40
Update your static model, Update your static model, againagain
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
41
What is a “quality” class?What is a “quality” class?
Coupling: should be loosely coupled Coupling: should be loosely coupled with other classeswith other classes
Cohesion: should be highly cohesiveCohesion: should be highly cohesive Sufficiency: does it do enough?Sufficiency: does it do enough? Completeness: does it cover all the Completeness: does it cover all the
relevant a abstractions?relevant a abstractions? Primitiveness: stick to basic operationsPrimitiveness: stick to basic operations
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
42
Detailed Static Model (1 of Detailed Static Model (1 of 3)3)
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
43
Detailed Static Model (2 of Detailed Static Model (2 of 3)3)
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
44
Detailed Static Model (3 of Detailed Static Model (3 of 3)3)
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
45
Code and TestCode and Test
Component Diagrams show packaging Component Diagrams show packaging of classes into distributable unitsof classes into distributable units
Usage scenarios Usage scenarios (use cases) become(use cases) become test scenarios test scenarios (test cases)(test cases)
We can link requirements, test cases We can link requirements, test cases and other software quality assurance and other software quality assurance (SQA) information to these models and (SQA) information to these models and follow them through the design.follow them through the design.
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
46
Key features of the ICONIX Key features of the ICONIX ProcessProcess
Avoidance of analysis paralysisAvoidance of analysis paralysis Streamlined usage of the UMLStreamlined usage of the UML Minimalist yet sufficientMinimalist yet sufficient High degree of traceabilityHigh degree of traceability Based on fundamental OOAD Based on fundamental OOAD
questionsquestions Work from the outside inWork from the outside in Work from the inside outWork from the inside out
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
47
Based on fundamental OOAD Based on fundamental OOAD questionsquestions
What are the users doing? (Jacobson)What are the users doing? (Jacobson) What are the objects in the real world? What are the objects in the real world?
(Rumbaugh)(Rumbaugh) What objects are needed for each use case? What objects are needed for each use case?
(Jacobson)(Jacobson) How do the objects collaborate with each other? How do the objects collaborate with each other?
(Jacobson and Booch)(Jacobson and Booch) How will we implement real-time control? (state How will we implement real-time control? (state
models)models) How are we really going to build this system? How are we really going to build this system?
(Booch)(Booch)
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
48
Work from the outside inWork from the outside in
Objectory and the ICONIX Process are use-case driven (outside-in)
By keeping use cases as the primary unit of system decomposition, we stay user-focused
By using prototyping in conjunction with use cases, we stay user-focused
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
49
Work from the inside outWork from the inside out
OMT was object driven OMT was object driven (inside-out)(inside-out)
OMT models == real-world OMT models == real-world (domain)(domain)
Some upfront thought about Some upfront thought about the problem domain makes the problem domain makes everything easiereverything easier
Reuse across systems Reuse across systems comes from the domain comes from the domain modelmodel
Copyright 2001 ICONIX Software Engineering, Inc. www.iconixsw.com
50
For further informationFor further information
EMAIL: [email protected]: [email protected] http://www.iconixsw.com/UMLBook.htmlhttp://www.iconixsw.com/UMLBook.html http://www.iconixsw.com/UMLTraining.html http://www.iconixsw.com/UMLTraining.html http://www.iconixsw.com/UMLecommerce.htmlhttp://www.iconixsw.com/UMLecommerce.html http://www.iconixsw.com/UMLworkbook.htmlhttp://www.iconixsw.com/UMLworkbook.html http://www.iconixsw.com/public_courses.htmhttp://www.iconixsw.com/public_courses.htm Phone: 310-458-0092Phone: 310-458-0092 FAX: 310-396-3454FAX: 310-396-3454 If interested in public class in SF Dec 10, 11 contact Jon If interested in public class in SF Dec 10, 11 contact Jon
GraffGraff [email protected] [email protected] 310-458-0092