隨筆 - 0, 文章 - 11, 評論 - 0, 引用 - 0
          數據加載中……

          代理模式 簡單模擬 ActionProxy

          結構圖:

          Action Interface :
          public interface Action {
              
          public String execute () ;
          }

          DispacherAction :
          public class DispacherAction implements Action {
              
          public String execute() {
                  System.out.println(
          "DispacherAction TODO somethin.");
                  
          return "result";
              }
          }

          ActionProxy:
          public class ActionProxy implements Action {
              
          private DispacherAction dispacherAction = new DispacherAction();
              
          public String execute() {
                  String result ;
                  System.out.println(
          "begin ActionProxy TODO somethin.");
                  result 
          = dispacherAction.execute() ;
                  System.out.println(
          "end ActionProxy TODO somethin.");
                  
          return result;
              }
          }

          執行結果:
          begin ActionProxy TODO somethin.
          DispacherAction TODO somethin.
          end ActionProxy TODO somethin.

          posted on 2014-05-14 17:47 00001000 閱讀(214) 評論(0)  編輯  收藏 所屬分類: 設計模式


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 张家界市| 香港 | 麻栗坡县| 万山特区| 七台河市| 栾川县| 庆安县| 大埔区| 马鞍山市| 托克逊县| 天镇县| 辉南县| 长乐市| 清新县| 琼中| 阳高县| 白山市| 弋阳县| 比如县| 筠连县| 平昌县| 巴中市| 项城市| 江门市| 缙云县| 嘉善县| 女性| 玉屏| 陕西省| 郯城县| 通化县| 龙里县| 平湖市| 白玉县| 金山区| 望谟县| 汪清县| 栖霞市| 壤塘县| 贵阳市| 乌鲁木齐县|