当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

复旦大学:《面向对象分析和设计》课程资料_UML和模式_Chapter 11 - 操作契约

资源类别:文库,文档格式:PPT,文档页数:19,文件大小:267.5KB,团购合买
点击下载完整版文档(PPT)

Chapter 11 操作契约

Chapter 11 操作契约

我们在哪儿 em Domain Sequence Operation Transition Modeling Diagrams Contracts to Design Architecture

我们在哪儿

Modeling date quantity Vision Use-Case Model ♀、< arnves names Require-i Use Case Diagre Use Case Text ments the doma the post- events attributes conditions/ associations at underg make Supplementary Post-conditions ( id, quantity) Operation Contracts 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 Require￾ments 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 post￾conditions

目标 口确定系统操作 口为系统操作创建契约

目标  确定系统操作  为系统操作创建契约

为什么需要操作契约 口用例和SSD是用来描述系统行为的主要方式,在 大多数情况下足以满足需求。 口有时需要对系统行为进行更为详细和精确的描述 口操作契约用于描述领域模型里对象的详细变化, 作为系统操作的结果

为什么需要操作契约  用例和SSD是用来描述系统行为的主要方式,在 大多数情况下足以满足需求。  有时需要对系统行为进行更为详细和精确的描述  操作契约用于描述领域模型里对象的详细变化, 作为系统操作的结果

什么是系统操作 口在SSD中定义了系统事件,而一个系统事件可以 通过一个系统操作来实现 口将所有用例的系统操作的完整集合封装到一个类 中,这个类定义了系统对外界的公共接口

什么是系统操作  在SSD中定义了系统事件,而一个系统事件可以 通过一个系统操作来实现。  将所有用例的系统操作的完整集合封装到一个类 中,这个类定义了系统对外界的公共接口

系统操作处理输入的系统事件 Process sale Scenario System Cashier makeNewsale0O… loop /[more items 1 enterltem(itemID, quantity) O these input system events evoke system operations the system event enterltem description, total invokes a system operation called enterltem and so forth endsaleo o-s is is the same as in object oriented programming when we say the message foo invokes the method(handling total with taxes operation) foo make Payment (amount change due, receipt

系统操作处理输入的系统事件 : Cashier enterItem(itemID, quantity) endSale() makePayment(amount) description, total total with taxes change due, receipt makeNewSale() these input system events invoke system operations the system event enterItem invokes a system operation called enterItem and so forth this is the same as in object￾oriented programming when we say the message foo invokes the method (handling operation) foo loop [ more items ] :System Process Sale Scenario

系统操作契约示例 口操作: enteritem( itemID: ItemID quantity: integer) 口交叉引用:处理销售用例 口前置条件:有一个正在进行的销售 口后置条件 创建了 Salelinelten的实例si(创建实例) Si与当前的Sale关联(形成关联) sli. quantity赋值为 quantity(修改属性) 基于 itemID的匹配,将Si关联到 Production Description(形成关联)

系统操作契约示例  操作: enterItem(itemID: ItemID, quantity: integer)  交叉引用:处理销售用例  前置条件:有一个正在进行的销售  后置条件: ◼ 创建了SaleLineItem的实例sli(创建实例) ◼ sli与当前的Sale关联(形成关联) ◼ sli.quantity赋值为quantity(修改属性) ◼ 基于itemID的匹配,将sli关联到 ProductionDescription(形成关联)

操作契约 口系统操作可以进一步通过操作契约来说明 口操作契约包括前置条件和后置条件。 口前置条件表述了操作前系统应该处于的状态 口后置条件 ■表述了操作后,领域模型内对象状态的变化。领域模 型状态的变化包括创建实例,形成或消除关联以及改 变属性。 后置条件不是在操作过程中执行的活动,它们是对领 域模型对象的观察结果

操作契约  系统操作可以进一步通过操作契约来说明。  操作契约包括前置条件和后置条件。  前置条件表述了操作前系统应该处于的状态  后置条件 ◼ 表述了操作后,领域模型内对象状态的变化。领域模 型状态的变化包括创建实例,形成或消除关联以及改 变属性。 ◼ 后置条件不是在操作过程中执行的活动,它们是对领 域模型对象的观察结果

Described-bt Product Specificatio Catalog description itemID Used-b Describ Sales Lineltem Store Item quantity address name 1 Contained completed Houses Sale Register date Started-by/ Manager time Paid-by 1 Initiated-by 4 Records-sales-on Payment Customer Cashier amount

点击下载完整版文档(PPT)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共19页,试读已结束,阅读完整版请下载
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有