第5讲细化阶段与领域模型.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
* * 5.2 为什么引入契约概念 用例是统一过程中描述系统行为的主要机制,而且通常也是足够的. 但是,某些时候我们需要对系统行为进行更详细的描述. * * 系统操作和系统接口 : Cashier :System addLineItem(itemID, quantity) endSale() makePayment(amount) description, total total with taxes change due, receipt * [more items] makeNewSale() 输入的系统事件 调用系统操作 系统事件 makeNewSale 调用 系统操作 makeNewSale 等等 这和面向对象编程一样 当我们说 消息 foo 调用了 方法 (处理操作 ) foo * * 契约的例子:enterItem enterItem 契约CO2: enterItem 操作(Operation): enterItem(itemID: ItemID, quantity: integer) 交叉参考(Cross References): Use Cases: Process Sale 前提(Preconditions): There is a sale underway 后置条件(Postconditions): -一个SalesLineItem的实例sli被创建 Sli与当前的 Sale 对象相关联 sli.quantity的数值被赋值 依据itemID的匹配, sli 与ProductSpecification相关联 * * 后置条件 后置条件描述了领域模型中对象状态的变化. 实例创建和删除 属性修改 关联形成和打破 后置条件与领域模型密切相关 在领域模型中创建实例和关联 * * 后置条件的优点 ? 描述了系统操作所需要的状态变化,而不需要描述如何实现的 后置条件: -SalesLineItem 的一个实例sli 被创建(instance creation) sli 与目前的Sale对象相关联 (association formed) sli.quantity 被赋值 (attribute modification) 依据itemID的匹配关系,sli 与ProductSpecification对象相关联 (association formed) 并未说明SalesLineItem的对象sli是如何被创建的 * * 我们需要完整的契约描述吗 契约可能并不需要 可以尽早编写后置条件,但是并不需要写得完整和详细,因为后面可以进一步改进 * * 契约 vs. 用例 用例是项目需求的主要表达手段 如果我们需要表示详细和复杂的状态变化,可以使用契约 * * 指南 为了制定一个契约: 从SSD中识别系统操作 对于复杂的,结果比较微妙的系统操作,或者在用例中表达不清楚的系统操作,构造一个契约 为了描述后置条件,使用下列列表 实例创建或删除 属性修改 关联形成或者打破 * The primary objectives of the elaboration phase include: To ensure that the architecture, requirements and plans are stable enough, and the risks sufficiently mitigated to be able to predictably determine the cost and schedule for the completion of the development. For most projects, passing this milestone also corresponds to the transition from a light-and-fast, low-risk operation to a high cost, high risk operation with substantial organizational inertia. To address all architecturally significant risks of the project To establish a baselined architecture derived from addressing the architecturally significant scenarios, which typically expose the top technical risks of the project. To produce an evolutionary protot

文档评论(0)

sandaolingcrh + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档