posts - 165, comments - 198, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          AOP 學習筆記

          Posted on 2007-10-18 18:16 G_G 閱讀(1607) 評論(3)  編輯  收藏 所屬分類: AOP
          如有錯誤大家多指教

          1.call(* *(..)) 和 execution(* *(..)) 區(qū)別
          ?
          call 和 execution 都為切面限定
          ? execution 進行切面添加只能在方法定義的開始和結(jié)束。如:
          ?? >>>AOP 添加
          ? ??? public String getName(){
          ? ??? ??? System.out.println("G_G");
          ??? ??? return this.name ;
          ??? }
          ?? >>>AOP 添加
          ? call進行切面添加沒有限定。如:
          ??? >>>AOP 添加
          ? ??? public String getName(){
          ????????? >>>AOP 添加
          ? ??? ??? System.out.println("G_G");
          ????????? >>>AOP 添加
          ??? ??? return this.name ;
          ??? }
          ?? >>>AOP 添加

          ???? 2.this within區(qū)別
          ?? 都為范圍限定作用,如: within(Demo) && execution( * *(..)) 在類Demo中的所有..
          ?? 區(qū)別是:this不能切靜態(tài),within沒有

          ?3.cflow的作用

          ? 我們從 1>cflow( within(DD+) && execution( * *(..)) )

          ???????? 2>within(DD+) && execution( * *(..)) 的區(qū)別來看
          ? 1與2的對比是在2的切入點下再加 aj 文件的方法 進行添加切入點。

          4.方法添加
          ? 如:Introduction Example例中的 CloneablePoint.aj
          ???? Point類繼承Clonable 添加
          clone() 方法
          ???declare?parents:?Point?implements?Cloneable;

          ???
          public?Object?Point.clone() throws?CloneNotSupportedException?{
          ??????
          return?super.clone();
          ???}

          ?? point.clone()....




          ??



          評論

          # re: AOP 學習筆記  回復  更多評論   

          2007-10-18 18:16 by G_G
          我會邊學習邊記錄的

          # re: AOP 學習筆記  回復  更多評論   

          2007-10-20 02:01 by bigboy
          好的!繼續(xù)堅持!

          # re: AOP 學習筆記  回復  更多評論   

          2007-11-22 19:33 by 專注JAVA開源

          http://www.agilesource.org/column_1_1.html

          這個地方很多不錯的JAVA AOP資料。

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


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 长丰县| 尖扎县| 新巴尔虎左旗| 广宁县| 花莲市| 灌阳县| 平度市| 梁平县| 明溪县| 建始县| 宁强县| 通辽市| 诸城市| 绥江县| 安义县| 自治县| 开原市| 永和县| 敖汉旗| 葫芦岛市| 偏关县| 黄骅市| 开阳县| 宁陕县| 万安县| 寿阳县| 凤翔县| 界首市| 滨海县| 右玉县| 获嘉县| 沙坪坝区| 苏尼特左旗| 海晏县| 桐乡市| 双流县| 和静县| 安溪县| 徐闻县| 平定县| 藁城市|