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: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 蓬莱市| 仪陇县| 淳化县| 东光县| 广宗县| 贵港市| 玉田县| 金山区| 汝州市| 安顺市| 霍州市| 砚山县| 边坝县| 千阳县| 甘孜县| 岳池县| 泰安市| 凭祥市| 冷水江市| 浪卡子县| 隆德县| 射洪县| 永嘉县| 城市| 岳阳市| 夏邑县| 香港 | 黄山市| 白水县| 微山县| 广西| 太和县| 武功县| 永清县| 孝昌县| 开江县| 三江| 连山| 台北县| 布尔津县| 苗栗县|