0% found this document useful (0 votes)
254 views

Teaching The Complete Object-Oriented Development Cycle, Including OOA and OOD, With UML and The UP

Uploaded by

Tanushree Guha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
254 views

Teaching The Complete Object-Oriented Development Cycle, Including OOA and OOD, With UML and The UP

Uploaded by

Tanushree Guha
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 42

Teaching the Complete Object-

oriented Development Cycle,


Including OOA and OOD, with
UML and the UP

Robert B. Jackson
Brigham Young University
John W. Satzinger
Southwest Missouri State University
We are teaching some OO
 Use case concepts
 UML class diagrams
 OO concepts
 OO programming languages
 Java
 VB .NET

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 2


San Diego All Rights Reserved
But are we teaching OOA and OOD?
 Highly iterative development process?
 Emphasis on interacting objects?
 Three-layer architectures?
 Use case realization through design?
 Design principles and quality design?
 Design patterns?
 Models that directly support OOP?

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 3


San Diego All Rights Reserved
OO Development using UML
and the UP
 Model Driven Development
 Analysis Models drive discovery and
understanding
 Design Models drive architecture and
solution
 Use Case Driven Development
 Both Analysis and Design based on use
cases

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 4


San Diego All Rights Reserved
UP phases and iterations
development life cycle

iteration phase

Ince
Elaboration Construction Transition
ption

Phases are NOT analysis, design, and implement; instead, each


Iteration involves a complete cycle of requirements, design,
implementation, and test disciplines

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 5


San Diego All Rights Reserved
UP disciplines and iterations
Incep- Transi
UP Disciplines Elaboration Construction
tion tion

Business Modeling

Requirements

Design

Implementation

Test

Deployment

Configuration &
Change Management

Project Management

Environment
Iterations — each a mini project including work in most disciplines and ending
with a stable executable

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 6


San Diego All Rights Reserved
Object-oriented
approach to
Requirements
OOA using UML Requirements
Models
What is OO Analysis?
 OOA is not a phase of an SDLC in the UP
 OOA per se is not used in the UP
 OOA is really business disciplines of
 Business Modeling
 Requirements
 Analysis
 OOA still implies “discovery” and
“understanding”
ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 8
San Diego All Rights Reserved
UML Models for Business
Modeling and Requirements
1. Use Case Models
 Use Case Diagram
 Use Case Descriptions
2. Activity Diagrams for Workflow
3. System Sequence Diagrams for
Inputs/Outputs
4. Domain Model Class Diagrams
5. Statecharts for Status Information

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 9


San Diego All Rights Reserved
Use Cases and Use Case
Diagram
 Although not “Object-oriented” it forms the
basis for all other analysis and design
activities – i.e. building a system is “Use
Case Driven.”
 Use Case Diagram contains “Actors” and
“Use Cases”

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 10


San Diego All Rights Reserved
A Partial Use
Checkout movies
Case Diagram
Return a movie

Clerk
Add new movie

Add new customer

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 11


San Diego All Rights Reserved
Detail Descriptions of Use Cases

 Fully developed description (textual)


 Activity Diagram (graphical)

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 12


San Diego All Rights Reserved
Fully Developed
Use Case Description
Use Case Name: Checkout Movies
Scenario: Checkout movies at counter
Triggering Event: Customer brings movies to checkout counter
Brief Description: When customer brings movies to counter, clerk checks membership ID,
clerk scans in each movie identifier, takes payment, and notifies
customer of return due date and time.
Actors: Video clerk
Related Use Add new member
Cases:
Stakeholders: Clerk, Store manager
Preconditions: Movie titles must exist
Movie copy must exist
Customer must exist (or Add new member must be invoked)
Postconditions: Video Rental and rental line items must be created
Payment transaction must be created
Status of movie copy must be updated
ISECON 2003 Copyright
Video Rental © 2003
must bebyconnected
R. B. Jackson to
andcustomer
J. W. Satzinger
family member Slide 13
San Diego All Rights Reserved
Fully Developed
Use Case Description (cont)
Flow of Events Actor System
1. Customer brings movies to 2.1 Checks membership ID.
checkout counter and 2.2 Checks for any outstanding fines
presents membership card. or late return fees.
2. Video clerk scans card 2.3 Displays appropriate information
3. Clerk scans each movie 2.4 Creates new Video Rental
4. Clerk indicates end of 3.1 Creates Rental line item
transaction 3.2 Updates movie copy status
5. If coupon or special, clerk 4.1 Display Total amount due,
enters coupon information including tax and late fees.
6. Enter payment 5.1 Recalculate amount due
7. Give movies, receipt, change 6.1 Process payment
to customer. 6.2 Print receipt
Exception 1.1 Customer is not a valid customer – invoke create new customer use
Conditions: case, or reject customer status.
6.1 If payment is by credit card and credit card transaction is not
authorized,
(a) cancel transaction or
ISECON 2003 (b) pay by cash.
Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 14
San Diego All Rights Reserved
Activity Diagram
 Diagram showing workflows
 Used to capture user procedures
 Used to describe sequence of steps for
Use Case description (similar to Fully
Developed Description)
 Easy for users to read and understand

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 15


San Diego All Rights Reserved
Clerk System
H

Activity Diagram No
New Title ?

for
Yes
Add New Movie Enter movie title
information

Build movie title


For each movie

Enter movie copy


information

Build movie copy

End for each

End

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 16


San Diego All Rights Reserved
System Sequence Diagram
 Use case driven (one SSD for each use
case)
 Identifies the inputs to and outputs from the
system
 Analysis oriented – focuses on the business
processes not on the internal system
interactions
 An easy introduction to Interaction Diagrams

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 17


San Diego All Rights Reserved
System Sequence Diagram for Add New Movie

:System

Clerk
[new movie] createTitle (title, format, category, price)

addMovie (movieID, copyNo, datePurchased)

confirmation
[for each movie]

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 18


San Diego All Rights Reserved
Problem Domain Class Diagram

 Coordinate with Database Course?


 Identifies problem domain objects and
relationships between those objects
 Analysis focuses only on problem domain
objects – discovery and understanding of
business objects

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 19


San Diego All Rights Reserved
Problem Domain Class Diagram
MovieTitle Customer
movieID customerID
title name
format address
category telephone
price status
1 1

1..* 1..*
MovieCopy LoanLineItem MovieLoan
rentalD
movieID 1 1..* rentalPrice rentalDate
copyNo
dueDate 1..* 1 totalAmt
datePurchased
dateReturned status
condition

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 20


San Diego All Rights Reserved
Statechart Diagrams
 Optional diagram – many developers do not
use
 Can be complex, therefore initially only
introduce simple cases
 Use for discovery and understanding of the
behavior of business objects
 Use to document “Status” conditions that the
system must track
ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 21
San Diego All Rights Reserved
Statechart Diagram
createMovieCopy ( )
H Ready for checkout

checkoutMovie ( ) returnMovie ( )

discardMovie ( )
Checked out H

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 22


San Diego All Rights Reserved
Recap of OOA
 We have a complete set of models that
describe many (all) aspects of the problem
domain and business requirements
 Problem oriented – discovery and
understanding
 Focuses on the business requirements
and not on design issues of the system

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 23


San Diego All Rights Reserved
Object Oriented
Approach to Design
OOD with UML Design
Models
What is OOD?
 OOD is not a phase in the UP SDLC
 OOD is a business disciplines in the UP
 OOD is the bridge between Requirements
and Programming
 OOD is a “developer” activity, not a user
activity
 Few programs teach OOD – mostly we
teach analysis and programming
ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 25
San Diego All Rights Reserved
UML Models for OOD
 Design Class Diagrams
 Problem domain classes
 View layer classes
 Data Access layer classes
 Detail Interaction Diagrams
 Sequence Diagrams
 Collaboration Diagrams
 Advanced Statechart Diagrams (optional)

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 26


San Diego All Rights Reserved
Making OOD an
“Engineering Discipline”
 Engineering disciplines have principles,
standards, techniques, practices, and
body of knowledge
 OOD is still developing, but we now are
beginning to see design principles and
practices

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 27


San Diego All Rights Reserved
Making OOD an
“Engineering Discipline”
 Principles of “good” design
 Cohesion
 Coupling
 Object Responsibility
 Protection from variations
 Object visibility
 Design Patterns for standard solutions
 Gang of four (GoF) design patterns
 Enterprise level design patterns (J2EE)
 Microsoft Application design patterns

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 28


San Diego All Rights Reserved
MovieTitle
movieID: integer <<Controller>> Customer
title: string UseCaseController customerID: integer
format: string name: string
category: string address: string
price: number addMovie ( … )
deleteMovie ( … ) telephone: string
addMovie (movieID, copyNo, status: string
ceateTitle ( …)
datePurchased)
deleteTitle ( …) startMovieLoan ( )
deleteMovie (movieID, copyNo)
startMovieLoan ( …) getStatus ( )
getPrice (movieID)
addLineItem ( … ) setStatus ( status )
setPrice (movieID)
... ...
...

MovieCopy LoanLineItem MovieLoan


movieID: integer rentalPrice: number rentalID: integer
copyNo: integer dueDate: date rentalDate: date
datePurchased: date dateReturned: date totalAmt: number
condition: string status: string
getCondition (movieID, getDateReturned ( ... ) addLineItem ( movieID, copyNo )
copyNo ) setDateReturned ( ... ) changeStatus ( status )
setCondition (movieID, ... makePayment ( amount )
copyNo ) ...
... ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 29
San Diego All Rights Reserved
Multi-layer Design Class
Diagrams
 Includes problem domain classes
 Includes service and utility classes
 Includes view layer classes
 Includes data access layer classes
 Advanced concepts
 Advanced design can get complex for enterprise level
systems
 Teach only the basics in SA&D – prepares students for
advanced concepts when they get into industry

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 30


San Diego All Rights Reserved
Detailed Interaction Diagrams
 Two types
 Sequence Diagrams
 Collaboration Diagrams
 Use Case Driven (for each use case)
 Show internal software objects that “collaborate”
to execute a use case
 Objects “collaborate” by sending messages to
each other
 Messages become method calls in OOP

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 31


San Diego All Rights Reserved
Sequence Diagrams
 Same components as SSD
 :System is exploded into internal objects
 Activation Lifeline is a rectangular box on
the object lifeline showing active
“execution”

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 32


San Diego All Rights Reserved
:UseCaseController

Clerk
[new movie] createTitle
(title, format, category, price) createTitle
(title, format, category, price)
:MovieTitle

addMovie
(movieID, copyNo, datePurchased)
addMovie
(movieID, copyNo, datePurchased)

aMovie := createMovie
(movieID, copyNo, datePurchased)
aMovie:MovieCopy
aMovie
confirmation (aMovie)
[for each movie]

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 33


San Diego All Rights Reserved
The Design Process
 Micro-level iterations (within a UP iteration)
 First cut at Design Class Diagram
 Type cast attributes
 Determine preliminary navigation visibility
 Micro Iteration 1
 With problem domain classes, develop sequence
diagram
 Micro iteration 2 (or more)
 Add view layer classes
 Add data access layer classes
 Add other service classes
ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 34
San Diego All Rights Reserved
Micro Iteration 1
 First – design with the problem domain
classes

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 35


San Diego All Rights Reserved
:UseCaseController

Clerk

[new movie] createTitle ( … )


createTitle ( … )
aMTitle:MovieTitle

addMovie ( … )

addMovie ( … )

aMovie := createMovie ( … )
aMovie:MovieCopy

aMovie

confirmation (aMovie)

[for each movie]


ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 36
San Diego All Rights Reserved
Micro Iteration 2
 Second – Add view layer (<<boundary>>)
classes

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 37


San Diego All Rights Reserved
<<Boundary>> :UseCaseController
:MovieMaintenance
Clerk

[new movie] createTitle ( … )


createTitle ( … )
createTitle ( … )
aMTitle:MovieTitle

addMovie ( … )
addMovie ( … )
addMovie ( … )

aMovie := createMovie ( … )
aMovie:MovieCopy

aMovie
aMovie
confirmation (aMovie)

[for each movie]


ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 38
San Diego All Rights Reserved
Micro Iteration 2 or 3
 Third – Add data access layer classes

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 39


San Diego All Rights Reserved
<<Boundary>> :UseCaseController
<<DataAccess>> <<DataAccess>>
:MovieMaintenance
Clerk :MovieTitleDB :MovieCopyDB

[new movie] createTitle ( … )


createTitle ( … )
createTitle ( … )
aMTitle:MovieTitle

saveTitle (aMTitle)

addMovie ( … )
addMovie ( … )
addMovie ( … )

aMovie := createMovie ( … )
aMovie:MovieCopy

aMovie saveMovie (aMovie)


aMovie
confirmation (aMovie)

[for each movie]


ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 40
San Diego All Rights Reserved
MovieTitle
movieID: integer <<Controller>> Customer
title: string UseCaseController customerID: integer
format: string name: string
category: string address: string
price: number addMovie ( … )
deleteMovie ( … ) telephone: string
addMovie (movieID, copyNo, status: string
ceateTitle ( …)
datePurchased)
deleteTitle ( …) startMovieLoan ( )
deleteMovie (movieID, copyNo)
startMovieLoan ( …) getStatus ( )
getPrice (movieID)
addLineItem ( … ) setStatus ( status )
setPrice (movieID)
... ...
...

MovieCopy LoanLineItem MovieLoan


movieID: integer rentalPrice: number rentalID: integer
copyNo: integer dueDate: date rentalDate: date
datePurchased: date dateReturned: date totalAmt: number
condition: string status: string
getCondition (movieID, getDateReturned ( ... ) addLineItem ( movieID, copyNo )
copyNo ) setDateReturned ( ... ) changeStatus ( status )
setCondition (movieID, ... makePayment ( amount )
copyNo ) ...
... ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 41
San Diego All Rights Reserved
Advance Topics
 Design patterns
 Statecharts for design
 Method logic on transitions action expressions
 System wide states, menu design, system
modes
 Enterprise level design (multilayer, and
many service components)

ISECON 2003 Copyright © 2003 by R. B. Jackson and J. W. Satzinger Slide 42


San Diego All Rights Reserved

You might also like