Dedian  
          -- 關注搜索引擎的開發
          日歷
          <2006年4月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456
          統計
          • 隨筆 - 82
          • 文章 - 2
          • 評論 - 228
          • 引用 - 0

          導航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 66093
          • 排名 - 813

          最新評論

          閱讀排行榜

          評論排行榜

           
          Purpose:
          Attach additional responsiblities to an object dynamically, which thus provide a flexible alternative to subclassing for extending functionality.

          Structure:
          Typically, there will be a parameter to pass original object to decorator object in its constructor, then decorator can implement additional functions within its own interface and apply to original object.

          when to use:

          -- when subclassing is not avaible
          -- when the responsibilities (for different functions) are required flexiable and dynamical
          -- can not predict combination of extending functionality. (We can not design subclasses for all combination of potential additional functionalities at compile time)

          reference:
          Book: Design Pattern (GoF)
          http://en.wikipedia.org/wiki/Decorator_pattern
          posted on 2006-04-20 08:53 Dedian 閱讀(237) 評論(0)  編輯  收藏 所屬分類: Design Patterns
           
          Copyright © Dedian Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 定结县| 治多县| 开鲁县| 塔河县| 龙南县| 马公市| 周至县| 永和县| 泾源县| 湾仔区| 洪江市| 洛宁县| 阳新县| 抚远县| 金门县| 舒城县| 西盟| 嵩明县| 南城县| 太保市| 台东县| 宜宾市| 龙江县| 都兰县| 望江县| 红河县| 夏津县| 文成县| 东明县| 土默特右旗| 屏边| 仙居县| 桃源县| 清水河县| 靖西县| 桓仁| 靖江市| 浑源县| 库伦旗| 秦皇岛市| 白山市|