• 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

  • 相关阅读:
    MySQL Explain优化
    mysql联合索引
    MySQL索引类型
    php常用的排序算法与二分法查找
    mysql 主从复制(mysql双机热备的实现)
    mysql 主从复制 (2)
    Linux 查看进程之PS命令
    PHP isset 和 array_key_exists 对比
    Linux md5sum 的用法
    Linux Sphinx 安装与使用
  • 原文地址:https://www.cnblogs.com/mayZhou/p/10536753.html
Copyright © 2020-2023  润新知