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

          導航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 65633
          • 排名 - 816

          最新評論

          閱讀排行榜

          評論排行榜

           
          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 閱讀(233) 評論(0)  編輯  收藏 所屬分類: Design Patterns
           
          Copyright © Dedian Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 和静县| 临西县| 通江县| 长海县| 双桥区| 久治县| 雷波县| 永新县| 健康| 博爱县| 和平区| 阳江市| 融水| 南乐县| 洛阳市| 磴口县| 耿马| 综艺| 黑山县| 行唐县| 麻江县| 光山县| 西丰县| 白水县| 宁陕县| 英德市| 云霄县| 辽阳市| 天峨县| 樟树市| 巴南区| 石城县| 尼木县| 于都县| 双峰县| 新平| 双辽市| 庆云县| 晋宁县| 班玛县| 泾阳县|