UML for Domain Models

27
UML FOR DOMAIN MODELS (Reference: Jason Roff – UML Beginner’s Guide)

description

(Reference: Jason Roff – UML Beginner’s Guide). UML for Domain Models. Grady Booch , Ivar Jacobson, Jim Rumbaugh Standard method of creating diagrams and modeling system architectures There are 14 Diagrams Types 7 Diagram Types are “Structural” 7 Diagram Types are “Dynamic”. - PowerPoint PPT Presentation

Transcript of UML for Domain Models

Page 1: UML for Domain Models

UML FOR DOMAIN MODELS(Reference: Jason Roff – UML Beginner’s Guide)

Page 2: UML for Domain Models

UNIVERSAL MODELING LANGUAGE (UML) Grady Booch, Ivar Jacobson, Jim

Rumbaugh Standard method of creating diagrams

and modeling system architectures There are 14 Diagrams Types

7 Diagram Types are “Structural” 7 Diagram Types are “Dynamic”

Page 3: UML for Domain Models

CLASSES Box

Top section is class name Second section is class attributes (data

members) Third section is class member functions

Notation + public access - private access # protected access

Page 4: UML for Domain Models

A UML CLASS DIAGRAM FOR COURSE

Course

-enrollmentLimit-nEnrolledStudents-startTime-endTime-instructor

+getInstructor()+getStartTime()+getDuration()

Page 5: UML for Domain Models

ATTRIBUTE FORMAT

-enrollmentLimit:Integer = 20-nEnrolledStudents: Integer=0-startTime: Date-endTime: Date-instructor: String-meetingDays[1..7]: Integer-/meetingHoursWeek:float

Page 6: UML for Domain Models

CLASS RELATIONSHIPS Show relationships with line and

association name.

Professor

Student

teaches >

takes

>

Course

Page 7: UML for Domain Models

MULTIPLICITY

Professor Course1 1..*

Professors teach 1 or more courses.Courses have exactly one professor.

teaches >

Page 8: UML for Domain Models

ROLES

Professor Course1 1..*

teaches >

Instructor

Graduate Student 0..*

0..*Teaching Assistant grades >

Page 9: UML for Domain Models

CLASS INSTANCES (OBJECTS) Objects are differentiated from class

with an underline and a class name qualifier

Course:Cs350

-enrollmentLimit = 20-nEnrolledStudents = 24-startTime : 14:00-endTime: 14:50-instructor: Ribler

Page 10: UML for Domain Models

INHERITANCE (EMPTY ARROW) Empty arrow points to base class

(superclass) from derived class (subclass)

Person

Professor

Student Tutor

Teaching Assistant

Page 11: UML for Domain Models

Car Class

COMPOSITION AND AGGREGATION

Engine Class

Composition is expressed with a filled diamond.Aggregation is expressed with a unfilled diamond.

List Class

Sprite Class

Page 12: UML for Domain Models

ACTIVITY DIAGRAMS Model workflows for use-cases

(analysis) Model object behavior (design)

Page 13: UML for Domain Models

SYMBOLS

Start Symbol

End Symbol

Activity Symbol (contains action name)

Name of Action

Decision Points

Page 14: UML for Domain Models

GUARDS WITH DECISION POINT

Create File Update File

[new file] [file already

exists]

Page 15: UML for Domain Models

GUARD WITHOUT DECISION POINT

Create File Update File

[new file] [file already

exists]

Record Data

Page 16: UML for Domain Models

EVENTS AND TRIGGERS Indicators that an action has taken

place

Ready

Print File

Save File

Create New File

Print(File, Printer)

SaveAs(Filename)

CreateNew(Filename)

Page 17: UML for Domain Models

FORKS Show concurrency

Login

Load Grades Load Classes

Page 18: UML for Domain Models

JOINS

Load Grades Load Classes

Display Data

Page 19: UML for Domain Models

SWIM LANESTelephoneOperator

POS System Database Wrapper

Determine Type Load

Inventory

Purchase()

Display Error [failur

e]Change

Inventory

Store Inventory

Display Error [failur

e]

Page 20: UML for Domain Models

SEQUENCE DIAGRAMS Model interaction between active

objects Consist of two components

Active objects Interactions between active objects

SpaceShip Shoot

Page 21: UML for Domain Models

“LIFELINES” INDICATE ACTIVE OBJECTS

SpaceShip UFO

Shoot

X

X indicates the end of the objects life.

Page 22: UML for Domain Models

CONDITIONS CAN BE PLACED ON MESSAGES INDICATE ACTIVE OBJECTS

SpaceShip UFO

Issue Warning[UFO in Range]

Page 23: UML for Domain Models

MESSAGE ARROWS Synchronous – Flow is suspended until return

from the call. (filled arrow head)

Return – Synchronous message is no longer blocked.

Asynchronous – Non-blocking message. Sender doesn’t wait for reply.

Flat – synchronization is unspecified.

Page 24: UML for Domain Models

CREATING AND DESTROYING OBJECTS

SpaceShip

Missile<<create>>

<<destroys>>X

Page 25: UML for Domain Models

SEQUENCE DIAGRAMS USE ROUNDED RECTANGLES TO INDICATE STATE

SpaceShip UFO

Issue Warning[UFO in Range]

Under Threat

Surrender

Taken Prisoner

Imprisoned

Page 26: UML for Domain Models

BRANCHINGSpaceShip UFO Asteroid

[in alien war]

[at peace]shoot

shoot

Page 27: UML for Domain Models

USERS CAN BE DRAWN AS STICK FIGURES

ATM

Login

Prompt for transaction typeLogged in