COP 4232 Software Systems Development Introduction to UML

  • Slides: 19
Download presentation
COP 4232 Software Systems Development Introduction to UML © Dr. David A. Workman School

COP 4232 Software Systems Development Introduction to UML © Dr. David A. Workman School of EE and CS University of Central Florida May 19, 2003 August 27, 2003 (c) Dr. David A. Workman

References • UML Specification (V 1. 3) Object Management Group (OMG), March 2000 OMG

References • UML Specification (V 1. 3) Object Management Group (OMG), March 2000 OMG Home • UML Reference Manual by Rumbaugh, Jacobson, & Booch Addison-Wesley, 1998 • UML Distilled by Martin Fowler and Kendall Scott Addison-Wesley, 1997 August 27, 2003 (c) Dr. David A. Workman 2

UML Introduction • Purpose “UML is a graphical language for visualizing, specifying, constructing, and

UML Introduction • Purpose “UML is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system. ” (OMG) “The UML represents the culmination of best practices in practical object-oriented modeling. ” (OMG) • History – “UML unifies the methods of James Rumbaugh, Grady Booch, and Ivan Jacobson. ” – Sally Shlaer & Steve Mellor (1989 – 91) OO Systems Analysis + Object Lifecycles – Peter Coad & Ed Yourdon (1991) (OOA & OOD) – Small. Talk (Wirfs-Brock) Class-Responsibility-Collaboration (CRC) Methodology – Booch/Rational work on Ada (1994 – 95) OO Analysis and Design with Apps. – Rumbaugh (GE) Object Modeling Technique (OMT) 1991 – 96 – Jim Odell & James Martin ( IS applications )(1994 – 96) – Jacobson (Ericsson) OO Software Engineering (1994 -95) – Rumbaugh joins Rational to work with Booch (1994) – Rational bought Objectory & Jacobson (1995) – Through OMG & Rational, UML was born. August 27, 2003 (c) Dr. David A. Workman 3

UML Concepts and Notation UML Things Relationships Dependency Association Generalization Structural Behavioral Grouping Annotational

UML Concepts and Notation UML Things Relationships Dependency Association Generalization Structural Behavioral Grouping Annotational Use case Class Active Class Interface Component Collaboration Node Interaction State Machine Package Model Subsystem Framework Note August 27, 2003 (c) Dr. David A. Workman Diagrams Use case Class Sequence Collaboration Statechart Activity Component Deployment 4

UML Concepts and Notation Class Name Active Class Name Attributes (private) Operations (public) Responsibilities

UML Concepts and Notation Class Name Active Class Name Attributes (private) Operations (public) Responsibilities (public) Use case Packages Component Note Name Textual content Name Analysis Boundary Class Control Class Relationships Association Dependency or Flow Refinement Generalization Composition Aggregation Actor { constraint } August 27, 2003 « stereotype » (c) Dr. David A. Workman exactly one Analysis Entity Class 1 zero or more * optional 0. . 1 bounded range m. . n class 5

UML Class & Object Examples Objects Class with details suppressed Abstract classes have italicized

UML Class & Object Examples Objects Class with details suppressed Abstract classes have italicized names Class with analysis-level details Class width: Length height: Length ready: Bool /area: Length 2 display() reset() attributes: type or description derived attributes denoted by “/” are computable from other attributes methods or responsibilities (functional capabilities) Class +size: Area(50, 100) #ready: Bool = false -winptr: Window& +display() +reset() -attach(Window& Obj) August 27, 2003 x : Point size = (20, 45) ready = true h /head: Point : Class with implementation-level details + denotes public accessibility # denotes protected accessibility - denotes private accessibility parameters and types specified accessibility attributes specified (c) Dr. David A. Workman An instance of class “Point” named “x” values of instance attributes Instance with /role specified. An anonymous instance of an active class Class Properties Class Name « boundary » {attribute = value, …} « stereotype » { class attributes } 6

UML Class Relationships Fig 3 -1 Class Diagram Theatre Seating. Capacity: Integer Offering( Id:

UML Class Relationships Fig 3 -1 Class Diagram Theatre Seating. Capacity: Integer Offering( Id: String): Bool Availability(): Dates[] 1 class Customer Name: String Phone: String 1 Reservation 1 holds * association aggregation aplace: Theatre Add(name, phone) 1. . * generalization Performance Seasonal Period: Date[] Make( D: Date[], T: Hours[] ) 0. . 1 6. . 12 multiplicities Constraint {xor} One_Time Make( D: Date, T: Hours ) 0. . 1 Ticket Show: String Show. Date: Date Show. Time: Hours Seat: Location 1 Instance attributes Set. Show( Pid: String ) Set. Date( D: Date) 0. . Seat. Capacity … August 27, 2003 (c) Dr. David A. Workman Id: String Start: Date End: Date Times: Hours[] Buy. Tickets( N: Integer) Available(): Integer Get. Times(): Hours[] Get. Dates(): Date[] 1 Class methods 7

Use Case Diagram Box Office actor ** system Buy tickets «include» ** Clerk Buy

Use Case Diagram Box Office actor ** system Buy tickets «include» ** Clerk Buy subscription relationships ** «include» Kiosk Make Payment Credit card service Use case ** Survey sales Supervisor August 27, 2003 (c) Dr. David A. Workman 8

Sequence Diagrams x: A Passive instance (x) in class ( A ) y: B

Sequence Diagrams x: A Passive instance (x) in class ( A ) y: B Active instance (y) in class ( B ) Z: Active one-of-a-kind object ( Z ) : C Arbitrary instance of passive class ( C ) Time period object is activated (passive or active) Time period object is suspended(active objects) or inactive (passive objects) Service( parms ) return value Service( parms ) Sender August 27, 2003 Procedure call Return from a call The object that reacts to call ( i. e. , provides "Service") Asynchronous call Receiver (c) Dr. David A. Workman 9

Sequence Diagrams : C y: B create destroy Recursive call return August 27, 2003

Sequence Diagrams : C y: B create destroy Recursive call return August 27, 2003 : D : E x: A X See ‘Notes’ Page (1) Branch in control alpha beta Merge in control (c) Dr. David A. Workman 10

UML Sequence Diagrams x: A y: B : E alpha beta Synchronous call from

UML Sequence Diagrams x: A y: B : E alpha beta Synchronous call from one active object to another return See ‘Notes’ Page August 27, 2003 (c) Dr. David A. Workman 11

Sequence Diagram: Example Kiosk Credit card service Box office Request(count, performance) Show availability(seat-list) Select(seats)

Sequence Diagram: Example Kiosk Credit card service Box office Request(count, performance) Show availability(seat-list) Select(seats) Demand payment(cost) Insert card(card number) Charge (card number, cost) authorized Print tickets(performance, seats) Eject card August 27, 2003 (c) Dr. David A. Workman 12

Collaboration Diagram Kiosk Active object 1: request(count, performance) 4: offer(seat-list) link 5: buy(seats) 8:

Collaboration Diagram Kiosk Active object 1: request(count, performance) 4: offer(seat-list) link 5: buy(seats) 8: confirm(seats, cost) ticket. Seller messages 3: seat-list: =lock(count) 6: claim(seats) 7: unlock(seat-list) Passive object db: Performance. DB «local» db Transient link 2: db: =find. DB(performance) performance. Guide August 27, 2003 multiobject dbs (c) Dr. David A. Workman : Performance. DB 13

State. Chart Initial state Assign to subscription Timed out Available lock state Locked buy

State. Chart Initial state Assign to subscription Timed out Available lock state Locked buy Sold unlock transition exchange Trigger event August 27, 2003 (c) Dr. David A. Workman 14

Activity Diagram Pick Show activity Schedule Show fork Publicize Show Buy scripts and music

Activity Diagram Pick Show activity Schedule Show fork Publicize Show Buy scripts and music Sell tickets Hire Artists Build Sets Make Costumes join rehearsal Completion transition [production cost met] Terminate Design Lighting Dress rehearsal [reviews good & sales good ] [cast not learned roles] Perform August 27, 2003 (c) Dr. David A. Workman 15

Component Diagram actor ** «database» Credit. Card. Charges Ticket. DB Credit. Card. Agency interface

Component Diagram actor ** «database» Credit. Card. Charges Ticket. DB Credit. Card. Agency interface Ticket. Seller subscription. Sales supplier purchase status group. Sales client Manage. Interface individual. Sales ** Supervisor Clerk. Interface Kiosk. Interface ** ** Clerk Customer August 27, 2003 (c) Dr. David A. Workman 16

Deployment Diagram (Class Level) ** actor Credit. Card. Agency ** Manager node Ticket. Server

Deployment Diagram (Class Level) ** actor Credit. Card. Agency ** Manager node Ticket. Server Credit. Card. Charges Manager. Interface component «database» Ticket. Seller 1 dependency Ticket. DB 1 communication association * * Customer. Interface Kiosk August 27, 2003 ** Customer Clerk. Interface ** Clerk (c) Dr. David A. Workman Sales. Terminal 17

Deployment Diagram (Instance Level) Node instance Main St. Kiosk: Kiosk Communication link Node name

Deployment Diagram (Instance Level) Node instance Main St. Kiosk: Kiosk Communication link Node name Node type Headquarters: Ticket. Server River St. box office: Sales. Terminal Telesales office: Sales. Terminal Valley Mall kiosk: Kiosk August 27, 2003 (c) Dr. David A. Workman 18

Packages and Subsystems «Subsystem» Planning Subsystem package Publicity «Subsystem» Box Office Customer Records Scheduling

Packages and Subsystems «Subsystem» Planning Subsystem package Publicity «Subsystem» Box Office Customer Records Scheduling dependency Ticket Sales Ticket Records «Subsystem» Operations Purchasing August 27, 2003 Accounting (c) Dr. David A. Workman Payroll 19