《模式——工程化实现及扩展》(设计模式C# 版)《桥模式 Bridge》——“自我检验"参考答案

转自:《模式——工程化实现及扩展》(设计模式C# 版)
http://www.cnblogs.com/callwangxiang/

 

 

 

1、分析依赖关系要点:

  1)IA、IB、IC、ID平级正交关系

  2) IE是IA的下级抽象关系

  3)IF和IG是IC的下级抽象关系,而且IC与IG为1:N的关系, II和IH是IG的下级抽象关系

 

  因此,仅从依赖关系分析,如设计配置文件,其结构大致如下:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  
<configSections>
    
<sectionGroup name="exercise" type="">
      
<section name="a" type=""/>
      
<section name="b" type=""/>
      
<section name="c" type=""/>
      
<section name="d" type=""/>
    
</sectionGroup>
  
</configSections>

  
<exercise>
    
<a>
      
<e/>
    
</a>
    
<b/>
    
<c>
      
<d>
        
<add name="d1" type="">
          
<i/>
          
<h/>
        
</add>
        
<add name="d2" type="">
          
<i/>
          
<h/>
        
</add>
      
</d>
    
</c>
    
<d/>
  
</exercise>
  
</configuration>

 

 

2、

团队职责的用例关系大致如下

 

桥模式分解各岗位职责分工后的依赖关系大致如下:

 

 

posted @ 2011-05-23 22:27  蜡笔小王  阅读(1063)  评论(0编辑  收藏  举报