摘要: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
阅读全文