2005/05/25 unified modeling lanauage 1 introduction to unified modeling language (uml) – part one...

16
2005/05/25 2005/05/25 Unified Modeling Lanauage Unified Modeling Lanauage 1 Introduction to Introduction to Unified Modeling Unified Modeling Language Language (UML) – Part One (UML) – Part One Ku-Yaw Chang Ku-Yaw Chang [email protected] [email protected] Assistant Professor Assistant Professor Department of Computer Science and Information Department of Computer Science and Information Engineering Engineering Da-Yeh University Da-Yeh University

Upload: dwain-dennis

Post on 26-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

2005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage 11

Introduction to Introduction to Unified Modeling LanguageUnified Modeling Language

(UML) – Part One(UML) – Part One

Ku-Yaw ChangKu-Yaw [email protected]@mail.dyu.edu.tw

Assistant ProfessorAssistant ProfessorDepartment of Computer Science and Information EngineeringDepartment of Computer Science and Information Engineering

Da-Yeh UniversityDa-Yeh University

Page 2: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

222005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Importance of modelingImportance of modeling

What is a model?What is a model? A simplification of realityA simplification of reality

Why do we model?Why do we model? Better understand the system we are Better understand the system we are

developingdeveloping

Page 3: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

332005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Four aimsFour aims

ModelsModels Help us to visualize a system as it is or as we Help us to visualize a system as it is or as we

want it to bewant it to be Permit us to specify the structure or behavior Permit us to specify the structure or behavior

of a systemof a system Give us a template that guides us in Give us a template that guides us in

constructing a systemconstructing a system Document the decisions we have madeDocument the decisions we have made

Page 4: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

442005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Unified Modeling Language (UML)Unified Modeling Language (UML)

A standard language for A standard language for VisualizingVisualizing SpecifyingSpecifying ConstructingConstructing DocumentingDocumenting

the artifacts of a software-intensive systemthe artifacts of a software-intensive system

Current official versionCurrent official version 2.02.0

Page 5: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

552005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Diagrams in the UMLDiagrams in the UML

A diagramA diagram Graphical presentation of a set of elementsGraphical presentation of a set of elements

Rendered as a connected graph of vertices Rendered as a connected graph of vertices (things) and arcs (relationships)(things) and arcs (relationships)

A projection into a systemA projection into a systemVisualize a system from different perspectivesVisualize a system from different perspectives

Page 6: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

662005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Diagrams in the UMLDiagrams in the UML

UML 2.0 defines 13 diagrams, divided into UML 2.0 defines 13 diagrams, divided into two general sets:two general sets: StructuralStructural modeling diagrams modeling diagrams

Define the static architecture of a modelDefine the static architecture of a model Classes, objects, interfaces and physical componentsClasses, objects, interfaces and physical components

Model the relationships and dependencies Model the relationships and dependencies between elementsbetween elements

BehavioralBehavioral modeling diagrams modeling diagramsCapture the varieties of interaction and Capture the varieties of interaction and instantaneous state within a model as it 'executes' instantaneous state within a model as it 'executes' over time. over time.

Page 7: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

772005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Structural diagrams (1/2)Structural diagrams (1/2)

Package diagramsPackage diagrams Divide the model into logical containers or 'packages' Divide the model into logical containers or 'packages'

and describe the interactions between them at a high and describe the interactions between them at a high levellevel

Class or Structural diagramsClass or Structural diagrams Define the basic building blocks of a model: the types, Define the basic building blocks of a model: the types,

classes and general materials that are used to classes and general materials that are used to construct a full modelconstruct a full model

Object diagramsObject diagrams Show how instances of structural elements are Show how instances of structural elements are

related and used at run-time. related and used at run-time.

Page 8: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

882005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Structural diagrams (2/2)Structural diagrams (2/2)

Composite structure diagramsComposite structure diagrams Provide a means of layering an element's structure Provide a means of layering an element's structure

and focusing on inner detail, construction and and focusing on inner detail, construction and relationshipsrelationships

Component diagramsComponent diagrams Model higher level or more complex structures, Model higher level or more complex structures,

usually built up from one or more classes, and usually built up from one or more classes, and providing a well defined interfaceproviding a well defined interface

Deployment diagramsDeployment diagrams Show the physical disposition of significant artifacts Show the physical disposition of significant artifacts

within a real-world setting within a real-world setting

Page 9: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

992005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Behavioral diagrams (1/2)Behavioral diagrams (1/2)

Use case diagramsUse case diagrams Model user/system interactions.Model user/system interactions. Define behavior, requirements and constraints in the Define behavior, requirements and constraints in the

form of scripts or scenariosform of scripts or scenarios

Activity diagramsActivity diagrams Define basic program flowDefine basic program flow Capture the decision points and actions within any Capture the decision points and actions within any

generalized processgeneralized process

State machine diagramsState machine diagrams Understanding the instant condition or "run state" of a Understanding the instant condition or "run state" of a

model when it executesmodel when it executes

Page 10: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

10102005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Behavioral diagrams (2/2)Behavioral diagrams (2/2)

Communication diagramsCommunication diagrams Show the network and sequence of messages or Show the network and sequence of messages or

communications between objects at run-time during a communications between objects at run-time during a collaboration instancecollaboration instance

Sequence diagramsSequence diagrams Show the sequence of messages passed between objects using Show the sequence of messages passed between objects using

a vertical timelinea vertical timeline

Timing diagramsTiming diagrams Fuse Sequence and State diagrams to provide a view of an Fuse Sequence and State diagrams to provide a view of an

object's state over time and messages which modify that state object's state over time and messages which modify that state

Interaction overview diagramsInteraction overview diagrams Fuse Activity and Sequence diagrams to provide allow Fuse Activity and Sequence diagrams to provide allow

interaction fragments to be easily combined with decision points interaction fragments to be easily combined with decision points and flows and flows

Page 11: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

11112005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Use case diagramUse case diagram

A use caseA use case A description of a set of sequences of actionsA description of a set of sequences of actions Rendered as an ellipseRendered as an ellipse

NamesNames A simple nameA simple name

A path nameA path namePrefixed by the name of the packagePrefixed by the name of the package

Place orderValidate user

Sensors::Calibrate location

Page 12: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

12122005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Use case diagramUse case diagram

An actorAn actor A coherent set of roles that users of use cases play A coherent set of roles that users of use cases play

when interacting with these use caseswhen interacting with these use cases Represents a roleRepresents a role

A humanA human

A hardware deviceA hardware device

Another systemAnother system

customer

Page 13: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

13132005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Use case diagramUse case diagram

ContentsContents Use casesUse cases ActorsActors Dependency, generalization, and association Dependency, generalization, and association

relationshiprelationship

Common UsesCommon Uses To model the To model the contextcontext of a system of a system

All things on the outside that interact with the system All things on the outside that interact with the system constitute the system’s contextconstitute the system’s context

To model the To model the requirementsrequirements of a system of a system

Page 14: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

14142005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Credit Card Validation System

Model the context of a systemModel the context of a system

Performcard transaction

Processcustomer bill

Performcard transaction

Retail institution

Managecustomer account

Sponsoringfinancial institution

Customer

Page 15: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

15152005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

Credit Card Validation System

Model the requirements of a systemModel the requirements of a system

Performcard transaction

Processcustomer bill

Performcard transaction

Retail institution

Managecustomer accountSponsoring

financial institution

Customer

Report onaccount status

Detectcard fraud

Managenetwork outage

Page 16: 2005/05/25 Unified Modeling Lanauage 1 Introduction to Unified Modeling Language (UML) – Part One Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor

16162005/05/252005/05/25 Unified Modeling LanauageUnified Modeling Lanauage

DemoDemo

Objecteering/UMLObjecteering/UML