GRASP基于职责设计对象.ppt

  1. 1、本文档共30页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
GRASP:基于职责设计对象 对象设计 设计的输入 对象设计 对象设计中的活动 确定设计方式 建立动态模型(交互图)和静态模型(类图) 应用设计模式 其它:UI和数据库设计等 输出 交互图、类图和包图 UI的草图和原型 数据库模型 报表的草图和原型 职责和职责驱动设计 对象的职责 行为 认知 准则:领域模型通常产生与“认知”相关职责 职责的粒度 职责与方法 RDD GRASP:基本OO设计的系统方法 GRASP:使用职责进行OO设计的学习工具 什么是设计模式 模式具有名称 “新模式” GRASP 9个基本的OO设计原则或primitive building block One person's pattern is another person's primitive building block. GRASP简短示例 涉及9个Pattern中的5个 Creator Information Expert Low Coupling Controller High Cohesion Information Expert Controller MVS原则 Controller 在对象设计中应用GRASP Creator Information Expert 讨论 it is a basic guiding principle used continuously in object design the fulfillment of a responsibility often requires information that is spread across different classes of objects. DIY 禁忌 because of problems in coupling and cohesion For example, who should be responsible for saving a Sale in a database? Information Expert 优点 Information encapsulation is maintained since objects use their own information to fulfill tasks. usually supports low coupling Behavior is distributed across the classes that have the required information . High cohesion is usually supported * IntellAgile IntellAgile 主讲:叶荣华 Copyright ? 2002 Craig Larman. All rights reserved. UML与设计原则 最关键的软件开发工具是受过良好设计原则训练的思维 职责、GRASP和UML图之间的关系 模式是对问题和解决方案的已命名描述 Creator Problem: Who creates the Square object? Creator Creator Problem: Who knows about a Square object, given a key? Information Expert why Expert is a useful (Low Coupling) Low Coupling Question: Why Board over Dog? Low Coupling Key Point: Expert Supports Low Coupling Controller Controller MonopolyGame Register PlayMonopolyHandler ~Session High Cohesion High Cohesion 谁创建它? Information Expert 谁负责得到销售总额? 谁负责小计? 谁回答价格?

您可能关注的文档

文档评论(0)

20010520 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档