UML - 技术中心

Download Report

Transcript UML - 技术中心

UML
ISKM Lab
What is UML ?
• UML stands for Unified Modeling Language
• The UML combines the best of the best from
–
–
–
–
Data Modeling concepts (Entity Relationship Diagrams)
Business Modeling (work flow)
Object Modeling
Component Modeling
What is UML ? (cont.)
• The UML is the standard language for visualizing,
specifying, constructing, and documenting the
artifacts of a software-intensive system
• It can be used with all processes, throughout the
development life cycle, and across different
implementation technologies
History of UML
History of UML (Cont.)
• UML 0.8 – 0.91
– Precursors of UML
• Object–oriented Modeling in Mid-1970 ~ late 1980s
• OOSE, OMT-2 and Booch’93 methods in 1990s
– Booch, Rumbaugh, and Jacobson Join Forces
• UML 0.8 in October of 1994 (Booch and Rumbaugh)
• UML 0.9 in June of 1996 (Booch, Rumbaugh and Jacobson)
• UML 0.91 in October of 1996 (Booch, Rumbaugh and
Jacobson)
History of UML (Cont.)
• UML 1.0 – 1.1
– UML Partners
• UML 1.0 in January of 1997 (IBM, HP, Microsoft,
Oracle, Digital Equipment Corp. … join UML)
• UML 1.1 in September of 1997 (Accepted by OMG
as OML)
• UML 1.3 in 1999 Spring
Goals of UML
• Enable the modeling of systems (and not just
software) using object-oriented concepts
• Establish an explicit coupling to conceptual as
well as executable artifacts
• Address the issues of scale inherent in complex as
well as executable artifacts
• Create a modeling language usable by both
humans and machines
Concepts of UML
• The UML may be used to:
– Display the boundary of a system & its major functions using use
cases and actors
– Illustrate use case realizations with interaction diagrams
– Represent a static structure of a system using class diagrams
– Model the behavior of objects with state transition diagrams
– Reveal the physical implementation architecture with component
& deployment diagrams
– Extend your functionality with stereotypes
• Five UML-View point
End User
Programmers
Functionality
Software management
Logical
View
Implementation
View
Analysts/Testers
Behavior
Process
View
Use Case
View
Deployment
View
System integrators
System engineering
Performance,Scalability,
Throughput
System topology,Delivery and
installation,Communication
• Use case view
– Specify system functionality for users, designers, and
test engineers
– Diagram: use case, sequence, collaboration, state,
activity diagram
• Design view
– Specify detailed design of the system’s internal
functionality, include use-cases and actors
– Diagram : class, object, state, sequence, collaboration,
activity diagram
• Implementation view
– Specify how to split the system how to the software
components and do implementation
– Diagrams : state, sequence, collaboration, activity
diagrams
• Process view
– Specify the operation of the entire system
– Diagrams: state, sequence, collaboration, activity
diagram
• Deployment view
– Specify the architecture of the system hardware and the
deployment of software processes
– Diagrams : state, sequence, collaboration, activity
diagram
Four layer meta-modeling architecture
Package structure
Top-level pachage
Foundation package
Behavior package
Meta-model package
Core package - backbone
Core package - relationships
Core-package - Dependency
Introduction of diagrams and Notations
Static View
Dynamic View
Sequence Diagram
Use Case Diagram
Class Diagram
Collaboration
Diagram
model
Object Diagram
State Chart
Component
Diagram
Activity Diagram
•
Categories of diagrams in UML
–
–
Dynamic view
Static view
Deployment
Diagram
Static View
•
•
•
•
Sequence Diagram
Collaboration Diagram
State Chart
Activity Diagram
Dynamic View
•
•
•
•
•
Use Case Diagram
Class Diagram
Object Diagram
Component Diagram
Deployment Diagram
Class Diagram
• 用來描述系統中種物件型態(types)和物件之間的靜態
關係。包括:
– 關連(associations):
代表類別(class)之間的關係
ex: 客戶租用錄影帶 (客戶和錄影帶之間的關連是租用)
– 子型態(subtypes):
兩類別之間的關係一般化
ex: 護士是一種人類 (護士是人類的子型態)
• 主要目的為表示出系統中概括性的名字與模式、敘述
類別間的合作關係及祥述資料庫邏輯綱要
Notations
Notations
Class comments
Notations (cont.) Class Diagram
Notations Generalization
Object Diagram
•類別模型所敘述的是所有可能的狀況,物件模
型所敘述的則是一個特定的狀況,因此,可用
來探索物件的各種不同型態,然後結合歸納到
類別圖中
• 顯示實例(instances)而非類別(class)
• 物件名字用實例名稱: 類別名稱表示
Object Diagram
Engineering: Organization
Location: “Boston”
Parent
Tools: Organization
Apps: Organization
Location: “Chicago”
Location: “Sabs”
Parent
Don: Person
John: Person
Location: “Champaign”
Location: “Champaign”
Example of insurance
Use case Diagram
• 獲取系統需求並表達使用個案(use case)與行為者(actor)間的
相互關係
• Use cases描述的是外部執行者(Actor)所理解的系統功能
• 用於需求分析階段,它的建立是系統開發者和用戶反覆討論的結
果,表明了開發者和用戶對需求規格達成的共識
– 描述了待開發系統的功能需求
– 將系統看作黑盒,從外部執行者的角度來理解系統
– 驅動了需求分析之後各階段的開發工作
Notations Use Cases
Example
State char
• 說明行為的狀態和回應
• 並說明一個物件的生命週期中的行為
• 描述一個特定對象的所有可能狀態及其引起狀態轉移
的事件
Notations (cont.)
Notations (cont.)
Example
Sequence Diagrams
• 以時間為主軸,敘述物件間之互動關係
• 用來描述對象之間動態的交互關系,著重表現對象間
消息傳遞的時間順序
Example of sequence diagram
Activity Diagram
• 說明一個參與行為之類別的活動和行為,並敘述類別
為回應內部處理所作的反應
• 指的是類別內的處理活動,而狀態圖是對外部事件所
作出的反應,所以可稱為狀態圖的變異版
• 由狀態圖變化而來的,它們各自用于不同的目的
• 活動圖依據對象狀態的變化來執行工作或活動
Example
Swim lanes
Fulfillment
Customer Service
Finance
Receive Order
Send Invoice
Fill Order
Deliver Order
Close Order
Receive Payment
Component Diagram &
Deployment diagram
• 元件圖(Component Diagram)在整體發展架構裡,扮
演的是系統的實作觀點,敘述軟體在實作元件之間的
組織架構及相依關係
• 佈署圖(Deployment Diagram)在整體發展架構裡,扮
演的是系統的環境觀點,敘述處理資源元素的組態,
以及軟體實作元件和其之間的對應方式
Example
Case study
• Our university wants to computerize their
registration system
–
–
–
–
–
Actors
Use Cases
Use Case Diagram
Sequence Diagram
Class Diagram
Actors
• An actor is someone or some thing that
must interact with the system under
development
Professor
Student
Billing System
Use Cases
• Actors are examined to determine their needs
–
–
–
–
Registrar -- maintain the curriculum
Professor -- request roster
Student -- maintain schedule
Billing System -- receive billing information from registration
Maintain Curriculum
Request Course Roster
Maintain Schedule
Use Case Diagram
• Use case diagrams are created to visualize the relationships
between actors and use cases
Sequence Diagram
• A sequence diagram displays object interactions arranged
in a time sequence
Class Diagram