7.8 GRASP原则八: 间接 Indirection

GRASP原则八: 间接 Indirection
   若两个对象直接连接,导致耦合太紧,如何解决?
3.1 GRASP rule8: Indirection 间接

   Name: Indirection

   Problem: 把职责分配到哪里可以避免两个或者多个对象之间的 直接耦合?如何解耦对象以保持较高的可重

    用性?

    Where to assign a responsibility to avoid direct coupling between two or more objects? How to

    de-couple objects so that reuse potential remains higher

   Solution: 把职责分配给一个中介对象,隔离对象与其他构件或 者服务,使它们不产生直接耦合

    Assign the responsibility to an intermediate object to mediate between other components or services

    so that they are not directly coupled

       因为中介对象是一种特殊的作用,一般对象与中间对象之间的直接耦合, 相对比较简单

转载于:https://www.cnblogs.com/mayZhou/p/10550047.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值