Dedian  
          -- 關(guān)注搜索引擎的開發(fā)
          日歷
          <2006年4月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456
          統(tǒng)計(jì)
          • 隨筆 - 82
          • 文章 - 2
          • 評論 - 228
          • 引用 - 0

          導(dǎo)航

          常用鏈接

          留言簿(8)

          隨筆分類(45)

          隨筆檔案(82)

          文章檔案(2)

          Java Spaces

          搜索

          •  

          積分與排名

          • 積分 - 65571
          • 排名 - 817

          最新評論

          閱讀排行榜

          評論排行榜

           
          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 閱讀(232) 評論(0)  編輯  收藏 所屬分類: Design Patterns
           
          Copyright © Dedian Powered by: 博客園 模板提供:滬江博客
          主站蜘蛛池模板: 武城县| 芷江| 开江县| 普安县| 扎赉特旗| 齐河县| 禹城市| 章丘市| 南部县| 旌德县| 万年县| 鸡东县| 沈阳市| 泸西县| 昭平县| 肇源县| 彰化县| 横峰县| 鲜城| 瑞昌市| 买车| 肇源县| 陆川县| 邯郸市| 沈阳市| 张家界市| 花莲县| 泰顺县| 舒城县| 富平县| 隆子县| 聂荣县| 怀安县| 开平市| 六盘水市| 张掖市| 合阳县| 桓台县| 清河县| 开远市| 金寨县|