l4-1-s1 uml overview © m.e. fayad 2000 -- 2005 sjsu -- cmpe software architectures dr. m.e. fayad,...

36
© M.E. Fayad 2000 -- 2005 SJSU -- CmpE L4-1-S1 UML Overview Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I College of Engineering San José State University One Washington Square San José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad

Post on 19-Dec-2015

217 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU -- CmpE L4-1-S1 UML Overview

Software Architectures

Dr. M.E. Fayad, Professor

Computer Engineering Department, Room #283I

College of Engineering

San José State University

One Washington Square

San José, CA 95192-0180

http://www.engr.sjsu.edu/~fayad

Page 2: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S2 UML Overview

2

Lesson 4-1:Unified Modeling Language

(UML) Overview

Page 3: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S3 UML Overview

Lesson Objectives

Objectives

3

The value of the UML

Contribution to the UML

Building Blocks of the UML

Diagrams in the UML

Page 4: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S4 UML Overview

Is an open standard Supports the entire software

development lifecycle – Debate Supports diverse applications areas Is based on experience and needs of

the user community Supported by many tools

4

The Value of the UML

Page 5: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S5 UML Overview

5

Contributions to the UML

Guess who?

Page 6: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S6 UML Overview

The UML is a language for– visualizing– specifying– constructing– documenting

the artifacts of a software-intensive system

6

Overview of the UML

Page 7: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S7 UML Overview

Things

Relationships

Diagrams7

Building Blocks of the UML

Page 8: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S8 UML Overview

Structural things– mostly static parts of a model

• class, interface, collaboration, use case, active class, component, node

Behavioral things– dynamic parts of UML models

• interaction, state machine Grouping things

– organizational parts of UML• package, subsystem

Other things– explanatory parts of UML

• note

Things in the UML

Page 9: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S9 UML Overview

Dependency– a semantic relationship between two things in which a

change to one thing (the independent thing) may affect the semantics of the other thing (the dependent thing)

Association– a structural relationship that describes a set of links

Relationships (1)

9

Page 10: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S10 UML Overview

Generalization– a specialization/generalization relationship

in which the child shares the structure and the behavior of the parent

Realization– a realization is a relationship in which one

classifier, such as an interface or a use case, specifies a "contract" that another classifier, such as a class or a collaboration, guarantees to carry out 10

Relationships (2)

Page 11: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S11 UML Overview

11

Diagrams in UML

Use CaseDiagramsUse Case

DiagramsUse CaseDiagrams

ScenarioDiagramsScenario

DiagramsCollaborationDiagrams

StateDiagramsState

DiagramsComponentDiagrams

ComponentDiagramsComponent

DiagramsDeploymentDiagrams

StateDiagramsState

DiagramsObjectDiagrams

ScenarioDiagramsScenario

DiagramsStatechartDiagrams

Use CaseDiagramsUse Case

DiagramsSequenceDiagrams

StateDiagramsState

DiagramsClassDiagrams

ActivityDiagrams

Models

+

Page 12: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S12 UML Overview

A diagram is a view into a model– Presented from the aspect of a particular stakeholder– Provides a partial representation of the system– Is semantically consistent with other views

In the UML, there are nine standard diagrams– Static views: use case, class, object, component,

deployment– Dynamic views: sequence, collaboration, statechart,

activity 12

Diagrams

Page 13: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S13 UML Overview

Shows a set of use cases and actors and their relationships

13

Use Case Diagram

Page 14: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S14 UML Overview

Captures system functionality as seen by users

Built in early stages of development Purpose

– Specify the context of a system– Capture the requirements of a system– Validate a system’s architecture– Drive implementation and generate test cases

Developed by analysts and domain experts 14

Use Case Diagram

Page 15: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S15 UML Overview

Shows a set of classes, interfaces, and collaborations and their relationships

15

Class Diagram (1)

Page 16: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S16 UML Overview

Captures the vocabulary of a system Addresses the static design view of a system Built and refined throughout development Purpose

– Name and model concepts in the system– Specify collaborations– Specify logical database schemas

Developed by analysts, designers, and implementers 16

Class Diagram (2)

Page 17: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S17 UML Overview

Shows a set of objects and their relationships

17

Object Diagram (1)

Page 18: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S18 UML Overview

Represents static snapshots of instances of the things found in class diagrams

Addresses the static design view or static process view of a system

Built during analysis and design Purpose

– Illustrate data/object structures– Specify snapshots

Developed by analysts, designers, and implementers 18

Object Diagram (2)

Page 19: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S19 UML Overview

Shows the organizations and dependencies among a set of components

19

Component Diagram (1)

Page 20: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S20 UML Overview

Addresses the static implementation view of a system

Built as part of architectural specification Purpose

– Organize source code– Construct an executable release– Specify a physical database

Developed by architects and programmers 20

Component Diagram (2)

Page 21: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S21 UML Overview

Shows the configuration of run-time processing nodes and the components that live on them

21

Deployment Diagram (1)

Page 22: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S22 UML Overview

Captures the topology of a system’s hardware

Built as part of architectural specification

Purpose– Specify the distribution of components– Identify performance bottlenecks

Developed by architects, networking engineers, and system engineers 22

Deployment Diagram (2)

Page 23: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S23 UML Overview

Shows the flow from activity to activity within a system

23

Activity Diagram (1)

Page 24: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S24 UML Overview

Captures dynamic behavior (activity-oriented)

A special kind of statechart diagram Purpose

– Model the function of a system– Model the flow of control among objects– Model business workflows– Model operations 24

Activity Diagram (2)

Page 25: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S25 UML Overview

Emphasizes the time-ordering of messages

25

Sequence Diagram (1)

Page 26: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S26 UML Overview

Captures dynamic behavior (time-oriented)

A kind of interaction diagram Purpose

– Model flow of control– Illustrate typical scenarios

26

Sequence Diagram (2)

Page 27: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S27 UML Overview

Emphasizes the structural organization of the objects that send and receive messages

27

Collaboration Diagram (1)

Page 28: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S28 UML Overview

Captures dynamic behavior (message-oriented)

A kind of interaction diagram Purpose

– Model flow of control– Illustrate coordination of object structure

and control

28

Collaboration Diagram (1)

Page 29: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S29 UML Overview

Shows a state machine, consisting of states, transitions, events, and activities

29

Statechart Diagram (1)

Page 30: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S30 UML Overview

Captures dynamic behavior (event-oriented)

Purpose– Model object lifecycleModel object lifecycle– Model reactive objects (user interfaces, Model reactive objects (user interfaces,

devices, etc.)devices, etc.)

30

Statechart Diagram (2)

Page 31: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S31 UML Overview

31

Architecture and the UML

OrganizationPackage, subsystem

DynamicsInteractionState machine

Design View Implementation View

Process View

Components Classes, interfaces,collaborations

Active classes

Deployment View

Nodes

Use Case ViewUse cases

Page 32: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S32 UML Overview

Use-case driven– use cases are used as a primary artifact for

establishing the desired behavior of the system, for verifying and validating the system’s architecture, for testing, and for communicating among the stakeholders of the project

Architecture-centric– a system’s architecture is used as a primary artifact

for conceptualizing, constructing, managing, and evolving the system under development

32

UML Software Development Life Cycle (1)

Page 33: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S33 UML Overview

Iterative – one that involves managing a stream of

executable releases

Incremental– one that involves the continuous integration

of the system’s architecture to produce these releases

33

UML Software Development Life Cycle (2)

Page 34: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S34 UML Overview

Inception Define the scope of the project and develop business case

Elaboration Plan project, specify features, and baseline the architecture

Construction Build the product

Transition Transition the product to its users 34

Lifecycle Phases

time

Inception Elaboration Construction Transition

time

Page 35: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S35 UML Overview

T/F

• UML is a model for developing software.

• A use case diagram shows a set of use cases, actors, and their relationships.

• Use case diagrams are dynamic models.

• An interaction diagram shows the flow of activities within the system.

• Sequence diagrams emphasizes the time-ordering of the messages.

35

Discussion Questions

Page 36: L4-1-S1 UML Overview © M.E. Fayad 2000 -- 2005 SJSU -- CmpE Software Architectures Dr. M.E. Fayad, Professor Computer Engineering Department, Room #283I

© M.E. Fayad 2000 -- 2005 SJSU – CmpE --- M.E. Fayad L4-1-S36 UML Overview

Use Case Models

Use Case Diagrams

Use Case Templates

Use Cases

36

Questions for the Next Lecture