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

          導航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 66091
          • 排名 - 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: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 荔波县| 濮阳市| 都匀市| 鸡东县| 民和| 什邡市| 怀安县| 平邑县| 广河县| 闽侯县| 拉萨市| 迭部县| 蓝田县| 图片| 长子县| 铜陵市| 兴化市| 开原市| 中卫市| 信宜市| 全南县| 五大连池市| 青冈县| 朝阳区| 平果县| 平潭县| 昌平区| 宜良县| 依兰县| 巫溪县| 樟树市| 仪陇县| 镇赉县| 鹤峰县| 峨眉山市| 金昌市| 巴楚县| 宁河县| 金乡县| 临高县| 名山县|