warning these slides are not optimized for printing or exam preparation. these are for lecture...

Post on 13-Dec-2015

222 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

WARNING

These slides are not optimized for printing or exam preparation. These are for lecture delivery only.

These slides are made for PowerPoint 2010. They may not show up well on other PowerPoint versions. You can download PowerPoint 2010 viewer from here.

These slides contain a lot of animations. For optimal results, watch in slideshow mode.

What is common?

models

What is common?

[… are representations of something else]

models… are not the real thing!

models… are simpler than the real thing!

models

models… capture different aspects

models… combat complexity

models… are indispensable for bigger projects

bigger roles in

models

Modelling your way out of complexity: Other useful

CS2103/T, Lecture 10, Part 2, [Oct 24, 2014]

models for what?

models for what?

i. for analysis

iii. as a blueprint

ii. for communication

In CS2103?

models for what?Most common use

models for what?Most common use

Nope, we don’t use UML

diagrams

i. for analysis ii. for communication

iii. as a blueprint

models for what?Most common use

i. for analysis ii. for communication

iii. as a blueprint

iii. as a blueprint

Model-Driven Development

Mobile, desktop, etc.Java, C++, etc.

Generate!

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Structure diagrams Behavior diagrams

……………………………. ……………………………

…………………………….…………………………….…………………………….…………………………….

…………………………….…………………………….…………………………….…………………………….

Behav

ior di

agra

msStructure diagrams

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Structure diagrams Behavior diagrams

……………………………. ……………………………

…………………………….…………………………….…………………………….…………………………….

…………………………….…………………………….…………………………….…………………………….

What is the object/class structure?

Problem Domain

Domain Analysis

Snakes&LaddersGame

Player

plays

Piece

Board

Square

Turn

number

owns

pla

yed

on

100

takes

is

on

2..*

1

*

AutoMover

Star

ts

in

1

1

*has

Die

FaceValue

dieValue

Ends

in

1

moves piece from

moves piece to

1

1

nameid

= Conceptual Class Diagrams

OO Domain Model

1

0..1

Snake

Ladder

Snakes&LaddersGame

Player

plays

Piece

Board

Square

Turn

number

owns

pla

yed

on

100

takes

is

on

2..*

1

*

AutoMover

Star

ts

in

1

1

*has

Die

FaceValue

dieValue

Ends

in

1

moves piece from

moves piece to

1

1

OO Domain Model

1

0..1

Snake

Ladder

nameid

*

Snakes&LaddersGame

Player

plays

Piece

Board

Square

Turn

number

owns

pla

yed

on

100

takes

is

on

2..*

1

*

AutoMover

Star

ts

in

1

1

*has

Die

FaceValue

dieValue

Ends

in

1

moves piece from

moves piece to

1

1

OO Domain Model

1

0..1

Snake

Ladder

nameid

*

Which class is least likely to appear in an OODM?

a) Student b) Grade c) StudentArrayListd) AcademicMentor

Pause video

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Behavior diagrams

OO domain models ……………………………

…………………………….…………………………….…………………………….…………………………….

…………………………….…………………………….…………………………….…………………………….

Structure diagrams

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Structure diagrams Behavior diagrams

OO domain models ……………………………

…………………………….…………………………….…………………………….…………………………….

…………………………….…………………………….…………………………….…………………………….

Package diagram

Package diagram Deployment diagram

Package diagram Deployment diagram

Component diagram

Component diagram

Composite structure diagram

Deployment diagramPackage diagram

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Structure diagrams Behavior diagrams

OO domain models ……………………………

Package diagramsDeployment diagramsComponent diagramsComposite structure diag.

…………………………….…………………………….…………………………….…………………………….

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Behavior diagrams

OO domain models ……………………………

…………………………….…………………………….…………………………….…………………………….

Package diagramsDeployment diagramsComponent diagramsComposite structure diag.

Structure diagrams

What is the workflow?

What is the workflow?

Activity Diagram

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

actions

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

Action 2

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

Show logo

Show ‘loading’ screen

Load file

Show file

Create file

[first time use]

init file

Activity Diagram

A

B

F

E

i. ABCEF

ii. ADBCF

iii. ABECF

iv. ABCF

v. ABCEDF

vi. ACBEF

D

C

A

B

F

E

i. ABCEF

ii. ADBCF

iii. ABECF

iv. ABCF

v. ABCEDF

vi. ACBEF

D

C

Are the other paths allowed?

A

B

F

E

i. ABCEF

ii. ADBCF

iii. ABECF

iv. ABCF

v. ABCEDF

vi. ACBEF

D

C

Pause video

A

B

F

E

i. ABCEF

ii. ADBCF

iii. ABECF

iv. ABCF

v. ABCEDF

vi. ACBEF

D

C

A

B

F

E

i. ABCEF

ii. ADBCF

iii. ABECF

iv. ABCF

v. ABCEDF

vi. ACBEF

D

C

A

B

F

E

i. ABCEF

ii. ADBCF

iii. ABECF

iv. ABCF

v. ABCEDF

vi. ACBEF

D

C

A

B

F

E

i. ABCEF

ii. ADBCF

iii. ABECF

iv. ABCF

v. ABCEDF

vi. ACBEF

D

C

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Behavior diagrams

OO domain models Activity diagrams

…………………………….…………………………….…………………………….…………………………….

Package diagramsDeployment diagramsComponent diagramsComposite structure diag.

Structure diagrams

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Structure diagrams Behavior diagrams

OO domain models Activity diagrams

…………………………….…………………………….…………………………….…………………………….

Package diagramsDeployment diagramsComponent diagramsComposite structure diag.

State-dependent behavior

An object, a component, or a whole system.

Who’s there?

hmmp…

come here baby

Go away

Ha?

Knock knock…

State-dependent behavior

PRE_GAME

LOST

READYnew

IN_PLAY

WON

deduce

deducededuce

deduce

[incorrect deduction]

[incorrect deduction]

[correct deduction]

[correct deduction && no more cells to deduce]

deduce [correct deduction && more cells to deduce]

/start timer

/stop timer

/stop timer

State-dependent behavior

PRE_GAME

LOST

READYnew

IN_PLAY

WON

deduce

deducededuce

deduce

[incorrect deduction]

[incorrect deduction]

[correct deduction]

[correct deduction && no more cells to deduce]

deduce [correct deduction && more cells to deduce]

/start timer

/stop timer

/stop timer

State-dependent behavior

PRE_GAME

LOST

READYnew

IN_PLAY

WON

deduce

deducededuce

deduce

[incorrect deduction]

[incorrect deduction]

[correct deduction]

[correct deduction && no more cells to deduce]

deduce [correct deduction && more cells to deduce]

/start timer

/stop timer

/stop timer

State Machine Diagram

PRE_GAME

LOST

READYnew

IN_PLAY

WON

deduce

deducededuce

deduce

[incorrect deduction]

[incorrect deduction]

[correct deduction]

[correct deduction && no more cells to deduce]

deduce [correct deduction && more cells to deduce]

/start timer

/stop timer

/stop timer

State Machine Diagram

states

PRE_GAME

LOST

READYnew

IN_PLAY

WON

deduce

deducededuce

deduce

[incorrect deduction]

[incorrect deduction]

[correct deduction]

[correct deduction && no more cells to deduce]

deduce [correct deduction && more cells to deduce]

/start timer

/stop timer

/stop timer

State Machine Diagram

state transitions

PRE_GAME

LOST

READYnew

IN_PLAY

WON

deduce

deducededuce

deduce

[incorrect deduction]

[incorrect deduction]

[correct deduction]

[correct deduction && no more cells to deduce]

deduce [correct deduction && more cells to deduce]

/start timer

/stop timer

/stop timer

State Machine Diagram

triggers

PRE_GAME

LOST

READYnew

IN_PLAY

WON

deduce

deducededuce

deduce

[incorrect deduction]

[incorrect deduction]

[correct deduction]

[correct deduction && no more cells to deduce]

deduce [correct deduction && more cells to deduce]

/start timer

/stop timer

/stop timer

State Machine Diagram

guard conditions

PRE_GAME

LOST

READYnew

IN_PLAY

WON

deduce

deducededuce

deduce

[incorrect deduction]

[incorrect deduction]

[correct deduction]

[correct deduction && no more cells to deduce]

deduce [correct deduction && more cells to deduce]

/start timer

/stop timer

/stop timer

State Machine Diagram

activity

PRE_GAME

LOST

READYnew

IN_PLAY

WON

deduce

deducededuce

deduce

[incorrect deduction]

[incorrect deduction]

[correct deduction]

[correct deduction && no more cells to deduce]

deduce [correct deduction && more cells to deduce]

/start timer

/stop timer

/stop timer

State Machine Diagram

State Machine Diagram

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Structure diagrams Behavior diagrams

OO domain models Activity diagrams

State Machine Diagrams…………………………….…………………………….…………………………….

Package diagramsDeployment diagramsComponent diagramsComposite structure diag.

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Structure diagrams Behavior diagrams

OO domain models Activity diagrams

State Machine Diagrams…………………………….…………………………….…………………………….

Package diagramsDeployment diagramsComponent diagramsComposite structure diag.

Timing diagram

Timing diagram Interaction overview diagram

Timing diagram Interaction overview diagram

Communication diagram

Timing diagram Interaction overview diagram

Class diagramsObject diagrams

Use casesSequence diag.

UML models

Structure diagrams Behavior diagrams

OO domain models Activity diagrams

State Machine diagramsTiming diagramsInteraction overview diag.Communication diag.

Package diagramsDeployment diagramsComponent diagramsComposite structure diag.

Use

Be aware

top related