码迷,mamicode.com
首页 > 其他好文 > 详细

3.4 面向对象分析(一)面向对象设计(初步)

时间:2019-03-15 14:35:57      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:ted   work   3.4   com   depends   res   about   sse   and   

一般原则

  ? An object-oriented system is composed of objects sending messages to other objects

  ? The quality of the overall design depends on which object is doing what

    ? 比喻:“人尽其责、各有所长”

  ? That is, the quality depends on how we assign responsibilities to the objects

  ? Problem:

    ? Define “good quality”?
职责驱动的设计 (RDD)

  ? RDD,Responsibility Driven Design

    ? Pioneered by Wirfs-Brock in early 90s

    ? Think of objects in terms of what they do or know (the human worker metaphor!)

      设计时考虑对象做什么、或者知道什么
    ? An object’s obligation or contract that it offers to other objects

      一个对象对其他对象承担的义务或者合约

    ? A responsibility is really a behavior the other classes depend on

      职责是一个对象的行为,而其他的对象依赖这种行为 
职责的定义 Responsibilities

  ? 这里定义为两类Knowing、Doing
  ? 认知职责 Knowing

    ? about private encapsulated data

    ? about related objects

    ? about things it can derive or calculate
  ? 行为职责 Doing

    ? doing something itself

    ? initiating action in other objects

    ? controlling and coordinating activities in other objects

3.4 面向对象分析(一)面向对象设计(初步)

标签:ted   work   3.4   com   depends   res   about   sse   and   

原文地址:https://www.cnblogs.com/mayZhou/p/10536753.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!