1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

84
1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling

Transcript of 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

Page 1: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

1

IBM Software Group

®

Essentials of Visual Modeling with UML 2.0Principles of Visual Modeling

Page 2: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

2

Objectives

Describe the importance of visual modeling. Define the four principles of visual

modeling. Explain what the Unified Modeling

Language (UML) represents.

Page 3: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

3

Where Are We?

What is modeling? Four principles of visual

modeling The UML

Page 4: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

4

What Is a Model?

A model is a simplification of reality.

Page 5: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

5

Why Model?

Modeling achieves four aims: Helps you to visualize a system as you want it to be. Permits you to specify the structure or behavior of a

system. Gives you a template that guides you in constructing a

system. Documents the decisions you have made.

You build models of complex systems because you cannot comprehend such a system in its entirety.

You build models to better understand the system you are developing.

Page 6: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

6

What is modeling? Four principles of visual

modeling The UML

Where Are We?

Page 7: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

7

Four Principles of Modeling

The model you create influences how the problem is attacked.

Every model may be expressed at different levels of precision.

The best models are connected to reality. No single model is sufficient.

Page 8: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

8

Design ModelProcess Model

Principle 1: The Choice of Model is Important

The models you create profoundly influence how a problem is attacked and how a solution is shaped. In software, the models you choose

greatly affect your world view. Each world view leads to a different

kind of system.

Deployment Model

Page 9: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

9

Principle 2: Levels of Precision May Differ

Every model may be expressed at different levels of precision. The best kinds of models let you choose your

degree of detail, depending on:

• Who is viewing the model. • Why they need to view it.

View for DesignersView for Customers

Page 10: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

10

Principle 3: The Best Models Are Connected to Reality

All models simplify reality. A good model reflects potentially fatal

characteristics.

Page 11: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

11

Principle 4: No Single Model Is Sufficient

No single model is sufficient. Every non-trivial system is best approached through a small set of nearly independent models. Create models that can be built and studied separately,

but are still interrelated.

Process View Deployment View

Logical View

Use-Case View

Implementation View

End-userFunctionality

ProgrammersSoftware management

Performance, scalability, throughputSystem integrators System topology, delivery,

installation, communication

System engineering

Analysts/DesignersStructure

Page 12: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

12

What is modeling? Four principles of visual

modeling The UML

Where Are We?

Page 13: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

13

What Is the UML?

The UML is a language for• Visualizing• Specifying• Constructing• Documenting

the artifacts of a software-intensive system.

Page 14: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

14

The UML Is a Language for Visualizing

Communicating conceptual models to others is prone to error unless everyone involved speaks the same language.

There are things about a software system you can’t understand unless you build models.

An explicit model facilitates communication.

Page 15: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

15

The UML Is a Language for Specifying

The UML builds models that are precise, unambiguous, and complete.

Page 16: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

16

The UML Is a Language for Constructing

UML models can be directly connected to a variety of programming languages. Maps to Java, C++, Visual Basic, and so on Tables in a RDBMS or persistent store in an

OODBMS Permits forward engineering Permits reverse engineering

Page 17: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

17

The UML Is a Language for Documenting

Use Case Diagram

Actor A

Use Case 1

Use Case 2

Use Case 3

Actor B

Class Diagram

GrpFile

read( )

open( )

create( )

fillFile( )

rep

Repository

name : char * = 0

readDoc( )

readFile( )

(from Persistence)

FileMgr

fetchDoc( )

sortByName( )

DocumentList

add( )

delete( )

Document

name : int

docid : int

numField : int

get( )

open( )

close( )

read( )

sortFileList( )

create( )

fillDocument( )

fList

1

FileList

add( )

delete( )

1

File

read( )

read() fill the

code..

Sequence Diagram

user

mainWnd fileMgr :

FileMgr

repositorydocument :

Document

gFile

1: Doc view request ( )

2: fetchDoc( )

3: create ( )

4: create ( )

5: readDoc ( )

6: fillDocument ( )

7: readFile ( )

8: fillFile ( )

9: sortByName ( )

ƯÁ¤¹®¼ ¿¡ ́ ëÇÑ º¸±â¸¦

»ç¿ëÀÚ°¡ ¿äûÇÑ´Ù.

È ÀÏ°ü̧ ®ÀÚ´Â Àоî¿Â

¹®¼ ÀÇ Á¤º¸¸¦ ÇØ´ç ¹®¼

°´Ã¼¿¡ ¼³Á¤À» ¿äûÇÑ´Ù.

È ̧é °´Ã¼´Â ÀоîµéÀÎ

°´Ã¼µé¿¡ ´ëÇØ ÀÌ̧ §º°·Î

Á¤·ÄÀ» ½ÃÄÑ È ̧é¿¡

º¸¿©ÁØ´Ù.

The UML addresses documentation of system architecture, requirements, tests, project planning, and release management.

The UML addresses documentation of system architecture, requirements, tests, project planning, and release management.

Deployment Diagram

Window95

¹®¼ °ü¸®

Ŭ¶óÀ̾ðÆ®.EXE

Windows

NT

¹®¼ °ü¸® ¿£Áø.EXE

Windows

NT

Windows95

Solaris

ÀÀ¿ë¼ ¹ö.EXE

Alpha

UNIX

IBM

Mainframe

µ¥ÀÌŸº£À̽º¼ ¹ö

Windows95

¹®¼ °ü¸® ¾ÖÇø´

ºÐ»ê È °̄æÀÇ Çϵå¿þ¾î¹× ³×Æ®¿÷À¸·ÎÀÇ Á¤º¸ ½Ã½ºÅÛ ¿¬°á ̧ ðµ¨

- À©µµ¿ì 95 : Ŭ¶óÀ̾ðÆ®

- À©µµ¿ì NT: ÀÀ¿ë¼ ¹ö

- À ´̄нº ̧ Ó½Å: ÀÀ¿ë ¼ ¹ö ¹× µ¥ÀÌŸ ¼ ¹ö, Åë½Å ¼ ¹ö

- IBM ¸ÞÀÎÇÁ·¹ÀÓ: µ¥ÀÌŸ ¼ ¹ö, Åë½Å ¼ ¹ö

Page 18: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

18

History of the UML

UMLPartners’ Expertise

UML 1.0(Jan. ‘97)

UML 1.1(Sept. ‘97)

UML 1.5(March, ‘03)

UML 2.0(2004)

Other Methods

Booch ‘91 OMT - 1OOSE

Booch ’93 OMT - 2

Public FeedbackUnified Method 0.8

(OOPSLA ’95)

UML 0.9(June ‘96)

UML 0.91(Oct. ‘96)

and

Page 19: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

19

Inputs to the UML

FusionOperation descriptions, message numbering

Before and after conditions

Meyer

HarelState charts

Wirfs-BrockResponsibilities

EmbleySingleton classes, High-level view

OdellClassificationObject lifecycles

Shlaer- Mellor

Gamma, et.alFrameworks, patterns, notes

BoochRumbaugh Jacobson

Selic, Gullekson, WardROOM (Real-Time Object-Oriented Modeling)

Page 20: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

20

IBM Software Group

®

Essentials of Visual Modeling with UML 2.0 Class Diagrams

Page 21: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

21

Objectives

Describe the static view of the system and show how to capture it in a model.

Demonstrate how to read and interpret a class diagram.

Model an association and aggregation and show how to model it in a class diagram.

Model generalization on a class diagram.

Page 22: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

22

Where Are We?

Class diagrams Class relationships

Association Aggregation Generalization

Page 23: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

23

What Is a Class Diagram?

Static view of a system

CloseRegistrationForm

+ open()+ close registration()

Student

+ get tuition()+ add schedule()+ get schedule()+ delete schedule()+ has pre-requisites()

Schedule- semester

+ commit()+ select alternate()+ remove offering()+ level()+ cancel()+ get cost()+ delete()+ submit()+ save()+ any conflicts?()+ create with offerings()+ update with new selections()

Professor- name- employeeID : UniqueId- hireDate- status- discipline- maxLoad

+ submitFinalGrade()+ acceptCourseOffering()+ setMaxLoad()+ takeSabbatical()+ teachClass()

CloseRegistrationController

+ is registration open?()+ close registration()

Page 24: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

24

Class Diagram Usage

When modeling the static view of a system, class diagrams are typically used in one of three ways, to model: The vocabulary of a system Collaborations A logical database schema

Page 25: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

25

Example: Class Diagram

Is there a better way to organize class diagrams?

CloseRegistrationForm

LoginForm

Professor

BillingSystem

CloseRegistrationController

RegisterForCoursesForm

Course

CourseCatalogSystem

Student

RegistrationController

CourseOffering

Schedule

Page 26: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

26

A general purpose mechanism for organizing elements into groups.

A model element that can contain other model elements.

A package can be used: To organize the model under development As a unit of configuration management

Review: What Is a Package?

University

Artifacts

Page 27: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

27

Example: Registration Package

Registration

CloseRegistrationForm CloseRegistrationController

RegisterForCoursesForm RegistrationController

Page 28: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

28

Class diagrams Class relationships

Association Aggregation Generalization

Where Are We?

Page 29: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

29

What Is an Association?

The semantic relationship between two or more classifiers that specifies connections among their instances.

A structural relationship specifying that objects of one thing are connected to objects of another thing.

CourseStudent Schedule

Page 30: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

30

Example: What Associations Can You Find?

: CourseOffering

: RegistrationController

: Schedule

: Student

: PrimaryScheduleOfferingInfo

8: any conflicts?( )

: RegisterForCoursesForm

2: submit schedule( )

4: submit( )3: save( )

7: still open?( )9: add student(Schedule)

5: is selected?( )10: mark as enrolled in( )

6: has pre-requisites(CourseOffering)

1: submit schedule( )

: Student

Page 31: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

31

What Is Multiplicity?

Multiplicity is the number of instances one class relates to ONE instance of another class.

For each association, there are two multiplicity decisions to make, one for each end of the association. For each instance of Professor, many Course Offerings

may be taught. For each instance of Course Offering, there may be

either one or zero Professor as the instructor.

Professor CourseOffering

0..1 0..*0..1 0..*

instructor

Page 32: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

32

Multiplicity Indicators

2..4

0..1

1..*

0..*

1

*

2, 4..6

Unspecified

Exactly One

Zero or More

Zero or More

Zero or One (optional value)

One or More

Specified Range

Multiple, Disjoint Ranges

Page 33: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

33

Example: Multiplicity

RegisterForCoursesForm

CourseOfferingSchedule0..4

0..*Student

0..*

1

RegistrationController1

1

1

1

0..1

0..1

0..1

Page 34: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

34

Class diagrams Class relationships

Association Aggregation Generalization

Where Are We?

Page 35: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

35

What Is an Aggregation?

A special form of association that models a whole-part relationship between the aggregate (the whole) and its parts. An aggregation is an “is a part-of” relationship.

Multiplicity is represented like other associations.

PartWhole

0..1

1

Page 36: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

36

Example: Aggregation

RegisterForCoursesForm

CourseOfferingSchedule0..4

0..*Student

0..*

1

RegistrationController1

1

1

1

0..1

0..1

0..1

Page 37: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

37

Class diagrams Class relationships

Association Aggregation Generalization

Where Are We?

Page 38: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

38

Review: What Is Generalization?

A relationship among classes where one class shares the structure and/or behavior of one or more classes.

Defines a hierarchy of abstractions where a subclass inherits from one or more superclasses. Single inheritance Multiple inheritance

Is an “is a kind of” relationship.

Page 39: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

39

Example: Single Inheritance

One class inherits from another.

CheckingSavings

Superclass (parent)

Subclasses(children)

Generalization Relationship

Descendents

Ancestor

Account

- balance- name- number

+ withdraw()+ createStatement()

Page 40: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

40

Example: Multiple Inheritance

A class can inherit from several other classes.

Use multiple inheritance only when needed and always with caution!

FlyingThing Animal

HorseWolfBirdHelicopterAirplane

Multiple Inheritance

Page 41: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

41

IBM Software Group

®

Essentials of Visual Modeling with UML 2.0 Interaction Diagrams

Page 42: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

42

Objectives

Describe dynamic behavior and show how to capture it in a model.

Demonstrate how to read and interpret: A sequence diagram A communication diagram

Explain the similarities and differences between communication and sequence diagrams.

Page 43: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

43

Objects Need to Collaborate

Objects are useless unless they can collaborate to solve a problem. Each object is responsible for its own behavior

and status. No one object can carry out every responsibility

on its own. How do objects interact with each other?

They interact through messages.

Page 44: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

44

Objects Interact with Messages

A message shows how one object asks another object to perform some activity.

: Car buyer:RegistrationController :CourseCatalogSystem

getCourseOfferings(forSemester)

Message

Page 45: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

45

What is an Interaction Diagram?

Generic term that applies to several diagrams that emphasize object interactions Sequence Diagram Communication Diagram

Specialized Variants Timing Diagram Interaction Overview Diagram

Page 46: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

46

Interaction Diagrams

Sequence Diagram Time oriented view of object

interaction

Communication Diagram Structural view of messaging

objectsCommunication

Diagrams

Sequence Diagrams

Page 47: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

47

Interaction Diagrams

Timing Diagram Time constraint view of

messages involved in an interaction

Interaction Overview Diagram High level view of interaction

sets combined into logic sequence

Timing Diagrams

Interaction Overview Diagrams

Page 48: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

48

Sequence diagrams Communication diagrams Interaction diagram

comparison

Where Are We?

Page 49: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

49

What Is a Sequence Diagram?

A sequence diagram is an interaction diagram that emphasizes the time ordering of messages.

The diagram shows: The objects participating in the interaction. The sequence of messages exchanged.

Sequence Diagram

Page 50: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

50

Example: Sequence Diagram

: Student :RegisterForCoursesForm :RegistrationController : Course Catalog:CourseCatalogSystem

1: create schedule( )

5: display course offerings( )

2: get course offerings( )

3: get course offerings(forSemester)

6: display blank schedule( )

4: get course offerings( )

Select Offeringsref

Page 51: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

51

Sequence Diagram Contents: Objects

:RegisterForCoursesForm :RegistrationController SWTSU Catalog : CourseCatalogSystem

Anonymous Objects

Lifelines

Named Object

Page 52: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

52

:RegisterForCoursesForm :RegistrationController SWTSU Catalog : CourseCatalogSystem

: Student : Course Catalog

Sequence Diagram Contents: Actor

Actor instances

Page 53: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

53

Sequence Diagram Contents: Messages

ReflexiveMessages

1: create schedule( )

2: get course offerings( )

3: get course offerings(for Semester)

4: get course offerings( )

:RegisterForCoursesForm :RegistrationController SWTSU Catalog : CourseCatalogSystem

: Student : Course Catalog

6: display blank schedule( )

5: display course offerings( )

Message

Page 54: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

54

1: create schedule( )

2: get course offerings( )

3: get course offerings(for Semester)

4: get course offerings( )

6: display blank schedule( )

:RegisterForCoursesForm :RegistrationController SWTSU Catalog : CourseCatalogSystem

: Student : Course Catalog

Sequence Diagram Contents: Execution Occurrence

Execution Occurrence

5: display course offerings( )

Page 55: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

55

1: create schedule( )

2: get course offerings( )

3: get course offerings(for Semester)

4: get course offerings( )

6: display blank schedule( )

:RegisterForCoursesForm :RegistrationController SWTSU Catalog : CourseCatalogSystem

: Student : Course Catalog

Sequence Diagram Contents: Event Occurrence

Event Occurrence

5: display course offerings( )

Page 56: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

56

1: create schedule( )

2: get course offerings( )

3: get course offerings(for Semester)

4: get course offerings( )

6: display blank schedule( )

:RegisterForCoursesForm :RegistrationController SWTSU Catalog : CourseCatalogSystem

: Student : Course Catalog

Sequence Diagram Contents: Interaction Occurrence

5: display course offerings( )

Select Offeringsref

Interaction Occurrence

Page 57: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

57

Sequence diagrams Communication diagrams Interaction diagram

comparison

Where Are We?

Page 58: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

58

What Is a Communication Diagram?

A communication diagram emphasizes the organization of the objects that participate in an interaction.

The communication diagram shows: The objects participating in the interaction. Links between the objects. Messages passed between the objects.

Communication Diagrams

Page 59: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

59

Example: Communication Diagram

: Student

: RegisterForCoursesForm

: RegistrationController : CourseCatalogSystem

5: display course offerings( )6: display blank schedule( )

: Course Catalog1: create schedule( )

2: get course offerings( )

3: get course offerings(forSemester)

4: get course offerings( )

Page 60: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

60

Communication Diagrams Contents: Objects

Objects

: RegisterForCoursesForm

: RegistrationController SWTSU Catalog : CourseCatalogSystem

Page 61: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

61

Communication Diagram Contents: Actors

: Student : Course Catalog

: RegisterForCoursesForm

: RegistrationController SWTSU Catalog : CourseCatalogSystem

Actors

Page 62: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

62

Communication Diagram Contents: Links and Messages

: Student

: RegisterForCoursesForm

: RegistrationController : CourseCatalogSystem

5: display course offerings( )

6: display blank schedule( )

: Course Catalog1: create schedule( )

2: get course offerings( )

3: get course offerings(forSemester)

4: get course offerings( )

Links

Messages

Page 63: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

63

Sequence diagrams Communication diagrams Interaction diagram

comparison

Where Are We?

Page 64: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

64

Sequence and Communication Diagram Similarities

Semantically equivalent Can convert one diagram to the other without

losing any information Model the dynamic aspects of a system Model a use-case scenario

Page 65: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

65

Sequence and Communication Diagram Differences

Sequence diagrams

Communication diagrams

Show the explicit sequence of messages

Show execution occurrence

Better for visualizing overall flow

Better for real-time specifications and for complex scenarios

Show relationships in addition to interactions

Better for visualizing patterns of communication

Better for visualizing all of the effects on a given object

Easier to use for brainstorming sessions

Page 66: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

66

IBM Software Group

®

Essentials of Visual Modeling with UML 2.0 Other UML Diagrams

Page 67: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

67

Objectives

Demonstrate how to read and interpret a: State machine diagram Component diagram Deployment diagram

Page 68: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

68

Where Are We?

State machine diagrams Component diagrams Deployment diagrams

Page 69: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

69

Review: An Object Has State State is a condition or situation during the life of

an object, which satisfies some condition, performs some activity, or waits for some event.

The state of an object normally changes over time.

Name: J ClarkEmployee ID: 567138Date Hired: July 25, 1991Status: TenuredDiscipline: FinanceMaximum Course Load: 3 classes

Name: J ClarkEmployee ID: 567138HireDate: 07/25/1991Status: TenuredDiscipline: FinanceMaxLoad: 3

Professor Clark

Page 70: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

70

Example: Professor

There are a sequence of events before an instructor becomes a University professor. Assistant professor (achieves tenure by

producing a number of quality publications) Tenure/Associate professor Professor (based on seniority)

Page 71: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

71

What Are State Machine Diagrams?

A state machine diagram models dynamic behavior.

It specifies the sequence of states in which an object can exist: The events and conditions that cause the object

to reach those states The actions that take place when those states

are reached

Assistant Professor

Tenured

Page 72: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

72

Special States

The initial state is the state entered when an object is created. An initial state is mandatory. Only one initial state is permitted. The initial state is represented as a solid circle.

A final state indicates the end of life for an object. A final state is optional. A final state is indicated by a bull’s eye. More than one final state may exist.

Applied

Page 73: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

73

What Are Events?

An event is the specification of a significant occurrence that has a location in time and space. An event is an occurrence of a stimulus that can

trigger a state transition. Example:

• Successful publication of numerous papers

TenuredAssistantProfessor

Event

Page 74: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

74

What Are Transitions?

A transition is a change from an originating state to a successor state as a result of some stimulus. The successor state could possibly be the originating

state. A transition may take place in response to an

event. Transitions can be labeled with event names.

Transition Event Name

TenuredAssistantProfessor maxPapers

Page 75: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

75

Example: State Machine

Hired

AssistantProfessor

Tenured

Professor

Applied

rejected

accepted

Hiatus

H

H

takeSabbatical

retired

maxPapers

seniority

return

Page 76: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

76

Where Are We?

State machine diagrams Component diagrams Deployment diagrams

Page 77: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

77

What Is a Component Diagram?

A diagram that shows the organizations and dependencies among components

ComponentA

<<component>>

ComponentC

<<component>>

ComponentB

<<component>>

ComponentD

<<component>>

Page 78: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

78

What Is a Component?

A modular part of a system that hides its implementation behind a set of external interfaces. Part of a logical or physical system

It conforms to and provides the physical realization of a set of interfaces.

It specifies the physical dependency to interfaces it requires.

Provided InterfaceName

Required InterfaceName

<<component>>Component NameComponentName

<<component>>

Page 79: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

79

Where Are We?

State machine diagrams Component diagrams Deployment diagrams

Page 80: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

80

What Is a Deployment Diagram?

The deployment diagram shows: Configuration of processing nodes at run-time Communication links between these nodes Deployed artifacts that reside on them

Page 81: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

81

What Is a Node?

Represents a run-time computational resource Generally has at least memory

and often processing capability.

Types: Device

• Physical computational resource with processing capability.

• May be nested Execution Environment

• Represent particular execution platforms

<<exe env>>EE Name

<<device>>Device Name

<<device>>Sub Device

Name

Page 82: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

82

What Is a Connector?

A connector represents a: Communication mechanism

• Physical medium• Software protocol

<<application server>>Server

<<RS-232>>

<<100-T Ethernet>>

Connector

<<client workstation>>Console

<<client workstation>>Kiosk

Page 83: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

83

Example: Deployment Diagram

<<legacy RDBMS>>Course Catalog

<<Campus LAN>>

<<Campus LAN>><<Campus LAN>>

<<application server>>Registration Server

<<client workstation>>PC

Billing System

<<legacy>>

0..2000

1

1

1

11

Page 84: 1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Principles of Visual Modeling.

84

Example: Deployment Diagram with Processes

<<legacy RDBMS>>Course Catalog

<<Campus LAN>>

<<Campus LAN>><<Campus LAN>>

<<application server>>Registration Server

<<client workstation>>PC

Billing System

<<legacy>>

CourseCatalogSystemAccessCourseRegistrationProcessBillingSstemAccess

StudentApplication

0..2000

1

1

11

1