zoukankan      html  css  js  c++  java
  • 7.2 GRASP原则二:信息专家 Information Expert

    2、GRASP原则二:信息专家 Information Expert
       What is a general principle of assigning responsibility to objects?

        为一个对象 分配职责的一般原则是什么?

       “鸡鸣狗盗” 战国时候,齐国的孟尝君喜欢招纳各种人做门客,号称宾客三千….
    2.2 GRASP rule2: Information Expert

       Name: Information Expert (信息专家)

       Problem:

         What is a general principle of assigning responsibility to objects?

       Solution:

         Assign responsibility to the class that has the information necessary to fulfill responsibility
       Information

         an object's own state,

         about other objects, the world around an object,

         information the object can derive,

         and so forth

       Answer to Mini exercise 2
    2.3 Information Expert — How to?

       步骤

         1)Clearly state the responsibility

         2)Look in Design Model for relevant classes

         3)Else look in Domain Model and create design classes

       信息专家的优点

         封装性 Encapsulation

           对象充分利用自身的信息 objects support their own information

           支持低耦合 supports low coupling

         系统行为分布到不同的类 Behavior is distributed across classes

           支持高内聚 supports high cohesion

  • 相关阅读:
    GPU CUDA之——深入理解threadIdx
    需求分析、业务逻辑与数据结构
    软件建模的本质
    浅谈软件需求建模
    软件建模即程序设计
    软件开发从0到1与软件建模
    数据模型所描述的内容包括三个部分:数据结构、数据操作、数据约束。
    观察力与信息搜集能力
    人类为什么写书
    鲁宾斯坦说:"思维是在概括中完成的。"
  • 原文地址:https://www.cnblogs.com/mayZhou/p/10550012.html
Copyright © 2011-2022 走看看