UML for Domain Models

Post on 23-Feb-2016

45 views 0 download

Tags:

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

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

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”

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

A UML CLASS DIAGRAM FOR COURSE

Course

-enrollmentLimit-nEnrolledStudents-startTime-endTime-instructor

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

ATTRIBUTE FORMAT

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

CLASS RELATIONSHIPS Show relationships with line and

association name.

Professor

Student

teaches >

takes

>

Course

MULTIPLICITY

Professor Course1 1..*

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

teaches >

ROLES

Professor Course1 1..*

teaches >

Instructor

Graduate Student 0..*

0..*Teaching Assistant grades >

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

INHERITANCE (EMPTY ARROW) Empty arrow points to base class

(superclass) from derived class (subclass)

Person

Professor

Student Tutor

Teaching Assistant

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

ACTIVITY DIAGRAMS Model workflows for use-cases

(analysis) Model object behavior (design)

SYMBOLS

Start Symbol

End Symbol

Activity Symbol (contains action name)

Name of Action

Decision Points

GUARDS WITH DECISION POINT

Create File Update File

[new file] [file already

exists]

GUARD WITHOUT DECISION POINT

Create File Update File

[new file] [file already

exists]

Record Data

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)

FORKS Show concurrency

Login

Load Grades Load Classes

JOINS

Load Grades Load Classes

Display Data

SWIM LANESTelephoneOperator

POS System Database Wrapper

Determine Type Load

Inventory

Purchase()

Display Error [failur

e]Change

Inventory

Store Inventory

Display Error [failur

e]

SEQUENCE DIAGRAMS Model interaction between active

objects Consist of two components

Active objects Interactions between active objects

SpaceShip Shoot

“LIFELINES” INDICATE ACTIVE OBJECTS

SpaceShip UFO

Shoot

X

X indicates the end of the objects life.

CONDITIONS CAN BE PLACED ON MESSAGES INDICATE ACTIVE OBJECTS

SpaceShip UFO

Issue Warning[UFO in Range]

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.

CREATING AND DESTROYING OBJECTS

SpaceShip

Missile<<create>>

<<destroys>>X

SEQUENCE DIAGRAMS USE ROUNDED RECTANGLES TO INDICATE STATE

SpaceShip UFO

Issue Warning[UFO in Range]

Under Threat

Surrender

Taken Prisoner

Imprisoned

BRANCHINGSpaceShip UFO Asteroid

[in alien war]

[at peace]shoot

shoot

USERS CAN BE DRAWN AS STICK FIGURES

ATM

Login

Prompt for transaction typeLogged in