1.2 uml 概念、历史简介
DESCRIPTION
1.2 UML 概念、历史简介. 徐迎晓 [email protected] 复旦大学软件学院. outline. UML 概念 What is a Model 面向对象 总结. outline. UML 概念 What is a Model 面向对象 总结. UML 概念. UML —— Unified Modeling Language. Modeling 用于表达现实的简化视图,以便于面向对象软件系统的设计与实现. outline. UML 概念 What is a Model 面向对象 总结. . . . - PowerPoint PPT PresentationTRANSCRIPT
outline
UML 概念What is a Model
面向对象总结
outline
UML 概念What is a Model
面向对象总结
UML 概念
UML—— Unified Modeling Language.
Modeling用于表达现实的简化视图,以便于面向对象
软件系统的设计与实现
outline
UML 概念What is a Model
面向对象总结
早期软件开发过程
Software Development项目管理、需求分析、质量保证、维护等
设计、实现 通常的过程
需求说明: 软件要做什么, 非正式描述,与未来的用户一起准备,
正式合同的基础, 常作为软件开发的起点形式 非正式的大纲 informal outline 高度详细和结构化的功能说明 程序员非正式的理解 原型系统(与未来用户一起开发)适合于 simple program, single programmer 数据和子程序结构在程序员脑子中
更复杂的过程
Structure chart : 系统结构特定方面的抽象视图整个程序功能分解为多个子程序
(subroutine) 以及子程序之间的调用关系这种功能的文档称为模型 (Model)
模型的作用
整个系统太复杂,难以一下子抓住,通过模型简洁地描述系统某个方面an abstract view of important aspects of the system
交流。(项目组成员之间,与客户)将系统体系结构归档
Architecting a dog house
Can be built by one personRequires
Minimal modelingSimple processSimple tools
Architecting a house
Built most efficiently and timely by a teamRequires
ModelingWell-defined processPower tools
Architecting a high rise
Early architectureProgress - Limited knowledge of theory
Modern architectureProgress - Advances in materials - Advances in analysis
Modeling a house
模型的分类分类:根据从何种角度来理解和描述系统的结构 Structured Methods :包括结构化分析,结构化设
计等 通常用 data flow diagram 描述数据如何经过各个处理流
程 适于关系数据库设计(大量数据,数据的处理可由数据之
外的函数处理) Object-oriented Methods : 将数据和函数统一
建议迭代、增量 (iterative, incremental) 开发 Example: UML
模型和语言
LanguageUML 主要是遵循精确语法的图形语言模型 Model+ 表示法 Notation
Model: 表示系统的结构设计系统时可以在高层进行讨论,而不用太早进入代码的细节
Notation: 以图表将模型文档化
UML 概念
Unified组合了当前最好的面向对象软件建模方法Grady Booch, James Rumbaugh, and Ivor
Jacobson , UML 三位主要贡献者1. OMT (James Rumbaugh)2. The Booch method (Grady Booch)3. OOSE (Ivar Jacobson)
outline
UML 概念What is a Model
面向对象总结
面向对象大师简介面向对象大师简介
Grady Booch Ivar Jacobson James Rumbaugh
James Rumbaugh
UML
Booch
Unified Method 0.8
UML 1.0
OMT OOSE/Objectory
UML 0.9
OOPSLA ´95
WWW - June ´96
Beta version OOPSLA ´96
Submission to OMG, Jan ´97
Documentation Set
WWW Spec only
Other methods
UML 1.1Submission to OMG, Sept ‘97OMG Vote, Oct ‘97
UML 1.4Sep. 2001
UML 1.2,1.3’98~’99
Mar. 2003 UML 1.5
Present UML 2.0Version 2.1.1.
面向对象的历史1960 年 - 70 年代 COBOL, FORTRAN, C 结构化分析和设计技术
1980 年 - 1990 年前 Smalltalk, Ada, C++, Visual Basic 早期面向对象生成(代码)方法
1990 年中晚期 Java UML Unified Process
分析模型 Analysis models描述应用领域
设计模型 Design models描述软件系统(如 Structure chart )
面向对象技术分析模型和设计模型之间使用相同的模型和建模概念,解决从分析阶段到设计阶段的过渡问题,防止不一致
outline
UML 概念What is a Model
面向对象总结
总结UML 是一种语言 遵循特定的规则 允许创建各种模型 并不告诉设计者需要创建哪些模型 并不提供开发过程
UML 是可视化语言 UML 是图形化语言 图形便于交流(一幅图抵上千文字)
UML 是用于构造系统或理解系统的语言 UML 既支持正向工程,又支持反向工程
总结UML 是文档化语言 将所建造的系统记录下来 便于新程序员跟进 开发产品新版本时很有用处
结构建模: 类图 对象图
行为建模 用例图 交互图(顺序图、协作图) 活动图 状态图
体系结构建模 构件图 实施图
Structure Modeling class diagram object diagram
Behavior Modeling use case diagram interaction diagram(Sequence diagram/collaboration
diagram) activity diagram statechart diagram
Architecture Modeling component diagram deployment diagram
20
Visual Modeling Using UML Diagrams
Actor A
Use Case 1
Use Case 2
Actor B
user : Clerk
mainWnd : MainWnd
fileMgr : FileMgr
repository : Repositorydocument : Document
gFile : GrpFile
9: sortByName ( )
L1: Doc view request ( )
2: fetchDoc( )
5: readDoc ( )
7: readFile ( )
3: create ( )
6: fillDocument ( )
4: create ( )
8: fillFile ( )
Window95
¹®¼ ° ü¸®Å¬¶óÀ̾ðÆ®.EXE
WindowsNT
¹®¼ ° ü¸® ¿£Áø.EXE
WindowsNT
Windows95
Solaris
ÀÀ¿ë¼ ¹ö.EXE
AlphaUNIX
IBM Mainframe
µ¥ÀÌŸº£À̽º¼ ¹ö
Windows95
¹®¼ ° ü¸® ¾ÖÇø´Document
FileManager
GraphicFile
File
Repository DocumentList
FileList
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 ( )
ƯÁ¤¹®¼ ¿¡ ´ëÇÑ º¸± ⸦»ç¿ëÀÚ° ¡ ¿äûÇÑ´Ù.
È ÀÏ° ü¸®ÀÚ´Â Àоî¿Â ¹®¼ ÀÇ Á¤º̧ ¸¦ ÇØ´ç ¹®¼ ° ´Ã¼¿¡ ¼³Á¤À» ¿äûÇÑ´Ù.
È ¸é ° ´Ã¼´Â ÀоîµéÀΰ ´Ã¼µé¿¡ ´ëÇØ À̸§ º° ·ÎÁ¤·ÄÀ» ½ÃÄÑ È ¸é¿¡º¸¿©ÁØ´Ù.
Forward and Reverse Engineering
TargetSystem
Openning
Writing
ReadingClosing
add file [ numberOffile==MAX ] / flag OFF
add file
close file
close fileUse Case 3
Use-CaseDiagram Class Diagram
Collaboration Diagram
Sequence Diagram
Component Diagram
StatechartDiagram
GrpFile
read( )open( )create( )
fillFile( )
rep
Repository
name : char * = 0
readDoc( )readFile( )
(from Persistence)
FileMgr
fetchDoc( )sortByName( )
DocumentList
add( )delete( )
Document
name : int
docid : intnumField : int
get( )open( )
close( )read( )
sortFileList( )
create( )fillDocument( )
fList
1
FileList
add( )delete( )
1
File
read( )
read() fill the
code..
Deployment Diagram