4、操作契约 Operation Contracts

   “用例描述”的补充

   强调: 用例中重要的动作,其开始与结束是需要一些约束

4.5 操作契约的后置条件

   定义Definition

     后置条件描述了领域对象状态的变化 describe changes in the state of objects in the domain model

     状态变化包括

       是否创建、删除了对象?instances created / deleted

       对象间的关系是否发生变化?associations formed or broken

       有对象的属性变化了吗?and attributes changed

   为什么要后置条件? Why post-condition

     也不是始终都需要的 they aren't always necessary

       如果开发人员很容易明白该如何去做,就不用写操作契约了

        If developers can comfortably understand what to do without them, then avoid writing contracts      操作契约比较细节地、精确地定义了一个操作应该承担的职责

     契约,是面向对象分析过程中非常有用的工具

       把问题说清楚、无歧义

       先不考虑设计,集中于分析 what must happen 而不是how it is to be accomplished
4.6 创建后置条件

   建议 Apply the following advice to create contracts

     Identify system operations from the SSDs .

     For system operations that are complex and perhaps subtle in their results,

        or which are not clear in the use case, build a contract

     To describe the postconditions, use the following categories:

       instance creation and deletion

       attribute modification

       associations formed and broken

   常见错误

     描述契约

       (better) A SalesLineItem was created

       (worse) A SalesLineItem is created; or Create a SalesLineItem

     忘记对象之间的关系发生了变化

       The SalesLineItem was associated with the Sale (association formed)
4.7 后置条件 & 领域模型

   后置条件体现在领域模型的对象 postconditions are expressed in the context of the Domain Model objects      What instances can be created?

       those from the Domain Model

     What associations can be formed?

       those in the Domain Model

     and so on

   在定义契约的过程中,经常触发对领域模型的修改

     记录新的概念类、属性 ?

     领域模型是否有新的关系 ?
4.8 对领域模型的修改

6.4 操作契约 Operation Contracts的更多相关文章

  1. 核心概念 —— 契约(Contracts)

    1.简介 Laravel中的契约是指框架提供的一系列定义核心服务的接口. 例如 ,Illuminate\Contracts\Queue\Queue契约定义了队列任务需要实现的方法,Illuminate ...

  2. UML和模式应用5:细化阶段(6)---操作契约

    1.前言 操作契约使用前置和后置条件,描述领域模型里对象的详细变化,作为系统操作的结果. 操作契约可以作为有用的OOA相关的制品. 操作契约可以视为UP用例模型的一部分,它是对用例之处的系统操作的效用 ...

  3. UML-如何画操作契约?

    1.在编写契约过程中,发现之前的领域模型不对,此时是否需要修改? 需要修改.包括:概念类.属性.关联.这就是不断迭代和进化 2.用例中复杂场景里的状态变化细节,描述过多导致用例臃肿,让人看不下去,因此 ...

  4. 各种操作中心Operation Center一览

    Operation Center在中国可能有很多种名称,例如指挥中心.运维室.总控中心等等,国外可能也有很多名称,不管名称如何,任何一个上规模得数据总心或者运维单位一般都有一个这样得中心,来负责所管理 ...

  5. PythonStudy——文件操作 File operation

    # 文件:就是硬盘的一块存储空间 # 1.使用文件的三步骤: # 打开文件- 得到文件对象:找到数据存放在硬盘的位置,让操作系统持有该空间,具有操作权# 硬盘空间 被 操作系统持有# 文件对象f 被 ...

  6. PythonStudy——字典的操作 Dictionary operation

    dic = {'a': 1, 'b': 2} print(dic) # 增: 字典名[key] = 值 => key已存在就是修改值,不存在就是新增值 dic['c'] = 3 print(di ...

  7. [Swift]LeetCode583. 两个字符串的删除操作 | Delete Operation for Two Strings

    Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 t ...

  8. deferred.promise.then().then()异步链式操作(Chain operation)

    //deferred.promise.then().then() deferred.promise.then(function () { console.log('1 resolve'); retur ...

  9. WCF基础

    初入职场,开始接触C#,开始接触WCF,那么从头开始学习吧,边学边补充. SOA Service-Oriented Architecture,面向服务架构,粗粒度.开放式.松耦合的服务结构,将应用程序 ...

随机推荐

  1. SP6779 GSS7

    GSS7解题报告 前言 唔,有点恶心哪,废了两个多小时debug 思路 很容易看出傻子都知道,这个是树链剖分+线段树的裸题,只不过是恶心了点,这里重点讲一下细节问题 线段树 做过GSS系列的都应该很熟 ...

  2. Paper Reading: In Defense of the Triplet Loss for Person Re-Identification

    In Defense of the Triplet Loss for Person Re-Identification  2017-07-02  14:04:20   This blog comes ...

  3. MPU6050

    MPU6050: Pitch,Roll,Yaw旋转方向遵循右手定则 pith角  –绕Y轴(俯仰)  范围:±90°  ,与旋转方向相反转是增大   -- 抬头为正,低头为负 roll角  –绕X轴( ...

  4. js 字符串加密解密

    Welcome to jzzy.com

  5. 【译】第21节---Fluent API

    原文:http://www.entityframeworktutorial.net/code-first/fluent-api-in-code-first.aspx 在前面的学习中.我们已经看到不同的 ...

  6. CSS属性大全

    字体属性:(font)大小 font-size:x-large;(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX.PD样式 font-style:oblique;(偏 ...

  7. javascript知识体系

    JAVASCRIPT 篇 0.基础语法 javascript基础语法包括:变量定义.数据类型.循环.选择.内置对象等. 数据类型有string,number,boolean,null,undefine ...

  8. _attribute_creature

    生物属性控制表 comment 备注 Entry 生物ID,对就creature_template中entry Level 不等于0时改变等级为该值 Health 不等于0时改变生命值为该值 Atta ...

  9. _itemmod_gem_limit

    该表可以控制特定宝石的数量上限,即使玩家多插了宝石,也不会有相应效果 `entry` 宝石ID `limitCount`上限值 `comment`备注

  10. Digits of Factorial LightOJ - 1045

    题目就不再发了,大致意思就是给你一个十进制数n,算出阶乘后转换成K进制的数,你来算一下它的位数. 坑点在哪呢,就是这个数可能算阶乘的时候没放弄了,比如1000000,做过最多单算阶乘的题也就是让你算到 ...