Sie sind auf Seite 1von 3

Class Diagram: A class diagram shows classes, their internal structures, and the static (compile-time) relationships among

them. Following class diagrams demonstrate various levels of detail, visibility, and properties of classes

abstract AbstractClassName abstractMethod() : ResultType method(arg_list)

ClassName - privateAttribute # protectedAttribute + publicAttribute +$ publicClassAttribute - privateMethod() # protectedMethod() + publicMethod() +$ publicClassMethod()

ClassName

ClassName attribute attribute : DataType ... for every attribute { attribute.foo(); }

Following class diagrams demonstrate different presentation options for the generalization and specialization of classes (inheritance) abstract Superclass attribute ... method() : ResultType ... Subclass Superclass

Subclass1 attribute attribute : DataType ...

Superclass other potential subclasses

Subclass2

Subclass1

Subclass2

Aggregation, navigabitliy and multiplicity WholeClass part1 : Part1Class part2 : Part2Class ... 0..1 0..* Part2Class aggregation bidirectional navigability part1 1..* Part1Class

Design pattern as collaboration of classes abstract QHsm abstract hierarchical state machine base class concrete HSMs myState : QState init() dispatch()

composite aggregation unidirectional navigability

pattern behavioral inheritance

Calc

QHsmTst

quantum L aPs

www.quantum-leaps.com

State Diagram: A state diagram shows the static state space of a given context class, the events that cause a transition from one state to another, and the actions that result.

transition event parameters trigger guard actions sent events

stateA

EVT (a, b) [guard()] / action(), ^EVT_A internal transition

stateName entry / action1() exit / x=3; y=1; EVT(a, b)[guard()] / action2() ...

initial transition Composite state, initial transitions, and the final state entry / action1() exit / x = 3; EVT / compositeStateName

self transition

initial transition superstate STOP

stateC C

stateA entry / A A

substate final state

stateB

Orthogonal regions and pseudostates

history pseudostate stateA dynamic choicepoint stateAB A X B [x > 0] Y stateBA C [else] stateBB stateAC B A stateB entry / actionB(); H

entry / actionA() stateAA

orthogonal regions

quantum L aPs

www.quantum-leaps.com

Sequence Diagram: A sequence diagram shows a particular sequence of events exchanged among objects at runtime. A sequence diagram has two dimensions: the vertical dimension represents time and the horizontal dimension represents different objects. Time flows down the page. (The dimensions can be reversed, if desired.)

objects

:QF

philo[m]:Philosopher thinking TIMEOUT

philo[n]:Philosopher thinking

table:Table

time

hungry HUNGRY(n) EAT(n) eating

TIMEOUT hungry HUNGRY(m) TIMEOUT thinking EAT(m) eating DONE(n)

optional states of the objects

quantum L aPs

www.quantum-leaps.com

Das könnte Ihnen auch gefallen