摘要:GOF设计模式三: 外观模式 Facade “现有系统”功能强大、复杂,开发“新系统”需要用到其中一部分,但又要增加一部 分新功能,该怎么办?4.1 Facade Pattern: Key Features Intent You want to simplify how to use an ex
阅读全文
摘要:其他面向对象设计原则3: 依赖倒置原则DIP The Dependency Inversion Principle7.1 依赖倒置原则DIP The Dependency Inversion Principle I. 高层模块不应当依赖低层模块 ,两者都依赖抽象 High-level modul
阅读全文
摘要:其他面向对象设计原则2 能用组合的地方,不要用继承 Favor object composition over class inheritance6.1 代码重用的两种方式 能用组合的地方不要用继承 Favor object composition over class inheritanc
阅读全文
摘要:GRASP原则六: 多态 Polymorphism How to handle alternative behaviors based on type 如何处理依据类型不同而有 不同行为的一类需求 ? 比如,开餐馆 苏州人喜欢甜、四川人喜欢麻、湖南人喜欢辣,咋处理 ?1.1 9条GRAS
阅读全文
摘要:GRASP原则五:高内聚 High Cohesion How to keep objects focused, understandable and manageable, and as a side effect support Low Coupling? 如何使对象功能专注、可理解、可管理,
阅读全文
摘要:4、GRASP原则四:控制器 Controller What first object beyond the UI layer receives and co-ordinates (controls) a system operation? 在领域层,由谁负责首先接收并协调来自UI层的系统操作?
阅读全文
摘要:3、GRASP原则三: 低耦合 Low Coupling How to support low dependency, low change impact and increased reuse? 如何保证设计方案支持低的依赖性、低的变化影响度、增加可重用性?3.2 耦合的定义Couplin
阅读全文
摘要:2、GRASP原则二:信息专家 Information Expert What is a general principle of assigning responsibility to objects? 为一个对象 分配职责的一般原则是什么? “鸡鸣狗盗” 战国时候,齐国的孟尝君喜欢招纳各
阅读全文
摘要:1、GRASP原则一: 创建者 Creator Who should be responsible for creating a new instance of some class 由谁来负责创建某个类的新实例(对象)1.1 GRASP 原则 GRASP General Respons
阅读全文
摘要:4、操作契约 Operation Contracts “用例描述”的补充 强调: 用例中重要的动作,其开始与结束是需要一些约束 4.5 操作契约的后置条件 定义Definition 后置条件描述了领域对象状态的变化 describe changes in the state of o
阅读全文
摘要:3、契约式设计 Design by Contract 可信软件设计的基础思想 谚语: When ideas fail, words come in very handy ! 他人译文“殚思竭虑之时,文字将成为利器” 本人认为“当想法失败时,总会出来许多理由辩解”3.1 问题的引入 由谁负责系
阅读全文
摘要: 1、准备高质量的”用例模型 ”… OOAD的主要输入!Use Case is the main input of OOAD1.1 用例模型 用例模型的组成 参与者 用例(取名:短小精悍的动名词,如“取钱”、“修改密码) 用例描述 (作为领域模型的输入、设计的输入、开发的输入…
阅读全文
摘要:系统顺序图 System Sequence Diagram 把待建系统看成一个黑盒子,研究参与者与系统边界的交互 SSD System Sequence Diagram What is SSD A SSD is a picture that shows, for one part
阅读全文
摘要: 敏捷建模Agile Modeling – 类图的草图 – 是否利用工具建模 创建领域模型的目的是快速地理解关键的概念,并在涉众之间交流 the purpose of creating a domain model is to quickly understand and communic
阅读全文
摘要:领域模型 Domain Model 什么是领域模型 一种概念模型,问题领域的概念的表示 A conceptual model,a representation of concepts in a problem domain 如何表示领域模型 简单地说, “没有定义操作的类图” 模
阅读全文
摘要:CRC 又称为CRC索引卡片:CRC card 每张卡片代表一个类 Each card represents one class 每张卡片上写出这个类承担的职责、与其合作交互的其他类名 CRC cards are paper index cards on which one writes
阅读全文
摘要:标识概念类和对象 原则 类,表示一组具有相同行为、属性的对象 Remember that a class represents a group (classification) of objects with the same behaviors 类,在表示对象群体的时候,一般用单数 G
阅读全文
摘要:一般原则 An object-oriented system is composed of objects sending messages to other objects The quality of the overall design depends on which object
阅读全文