zoukankan      html  css  js  c++  java
  • 3.4 面向对象分析(一)面向对象设计(初步)

    一般原则

       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

  • 相关阅读:
    冲刺成果演示
    c#输入串字符不符
    课堂测试—数据清洗
    mapreduce实验
    问题纠错
    软件需求阅读笔记第一篇
    暑假第五周总结
    暑假第四周总结
    暑假第三周总结
    暑假第二周总结
  • 原文地址:https://www.cnblogs.com/mayZhou/p/10536753.html
Copyright © 2011-2022 走看看