Chapter 14 迈向对象设计8。 ●●●●● ●●●● ●●。●●
Chapter 14 迈向对象设计
●●●●● ●●●● 大纲 ●●● ●●● ●●●● ●理解动态和静态建模 ●尝试敏捷建模,或用于绘图的∪ML工具
大纲 ⚫ 理解动态和静态建模 ⚫ 尝试敏捷建模,或用于绘图的UML工具
●●●●● ●●●● 什么是动态模型和静态模型 ●●● ●●● ●●●● ●动态模型: ●用于设计处理逻辑,代码行为或方法体 ●UML交互图用于描述动态模型 ●静态模型 ●设计包,类,方法名,属性关联 UML的类图用于描述静态模型
什么是动态模型和静态模型 ⚫ 动态模型: ⚫ 用于设计处理逻辑,代码行为或方法体 ⚫ UML交互图用于描述动态模型 ⚫ 静态模型 ⚫ 设计包,类,方法名,属性关联 ⚫ UML的类图用于描述静态模型
●●●●● ●●●● 动态对象建模 ●●● ●●● ●●●● ●UML的初学者一般都会认为静态视图的类图是 最重要的模型,但事实上,大部分具有挑战性, 有益和有效的设计工作都会在绘制动态视图的 交互图时发生 ●职责驱动的设计 职责分配的原则 设计模式
动态对象建模 ⚫ UML的初学者一般都会认为静态视图的类图是 最重要的模型,但事实上,大部分具有挑战性, 有益和有效的设计工作都会在绘制动态视图的 交互图时发生。 ⚫ 职责驱动的设计 ⚫ 职责分配的原则 ⚫ 设计模式
Domain model ●●●●● ●●●● Busines Modeling ●●● date ●●● quantity ●●●● Use-Case model Vision ♀、< arnves names Require-i Use Case Diagre Use Case Text ments the domai the post- events attributes conditions/ associations at underg make Supplementary changes system Post-conditions ( id, quantity) System Sequence Diagrams requirements that Design Mode must be satisfied Product catalog Design
Operation: enterItem(…) Post-conditions: - . . . Operation Contracts Sale date . . . Sales LineItem quantity 1 1..* . . . . . . Domain Model Use-Case Model Design Model : Register enterItem (itemID, quantity) : ProductCatalog spec = getProductSpec( itemID ) addLineItem( spec, quantity ) : Sale Requirements Business Modeling Design Sample UP Artifact Relationships : System enterItem (id, quantity) Use Case Text System Sequence Diagrams make NewSale() system events Cashier Process Sale : Cashier use case names system operations Use Case Diagram Vision Supplementary Specification Glossary starting events to design for, and more detailed requirements that must be satisfied by the software Process Sale 1. Customer arrives ... 2. ... 3. Cashier enters item identifier. the domain objects, attributes, and associations that undergo changes requirements that must be satisfied by the software ideas for the postconditions