資源簡介
一、 實驗目的
1、了解AOP的概念和作用;
2、理解AOP中的相關術語;
3、了解Spring中兩種動態代理方式的區別;
4、掌握基于XML和注解的AspectJ開發。
二、 實驗內容
1、按圖所示的類圖結構,設計接口及其實現類,并完成另外兩附加要求:(1)日志功能:在程序執行期間追蹤正在發生的活動(打印出調用的方法,以及參數的參數值);(2)驗證功能:希望計算器只能處理正數的運算,當有負數參與運算時,給出提示說明。
分別使用基于XML和注解的AspectJ實現上述功能(創建兩個項目)。
(圖就是int加減乘除)

代碼片段和文件信息
package?com.lyy.experiment;
public?interface?ArithmeticCalculator?{
public?int?add(int?iint?j);
public?int?sub(int?iint?j);
public?int?mul(int?iint?j);
public?int?div(int?iint?j);
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????27760??2018-06-05?22:52??實驗.docx
?????文件????????115??2018-06-05?22:52??說明文檔.txt
????I.A....?????12021??2018-06-05?22:50??運行結果.png
?????文件???????1203??2018-06-04?15:43??experiment\.classpath
?????文件????????910??2018-06-04?14:43??experiment\.project
?????文件????????567??2018-06-04?14:43??experiment\.settings\.jsdtscope
?????文件????????364??2018-06-04?14:43??experiment\.settings\org.eclipse.jdt.core.prefs
?????文件????????482??2018-06-04?14:56??experiment\.settings\org.eclipse.wst.common.component
?????文件????????305??2018-06-04?14:43??experiment\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2018-06-04?14:43??experiment\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2018-06-04?14:43??experiment\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件????????808??2018-06-05?20:13??experiment\build\classes\com\lyy\experiment\applicationContext.xm
?????文件????????204??2018-06-05?19:37??experiment\build\classes\com\lyy\experiment\ArithmeticCalculator.class
?????文件????????902??2018-06-05?20:15??experiment\build\classes\com\lyy\experiment\ArithmeticCalculatorImpl.class
?????文件???????2655??2018-06-05?22:54??experiment\build\classes\com\lyy\experiment\MyAspect.class
?????文件???????1123??2018-06-05?21:31??experiment\build\classes\com\lyy\experiment\Testxm
?????文件???????1303??2018-06-05?22:48??experiment\build\classes\com\lyy\experimentxm
?????文件????????207??2018-06-05?22:29??experiment\build\classes\com\lyy\experimentxm
?????文件????????911??2018-06-05?22:47??experiment\build\classes\com\lyy\experimentxm
?????文件???????2344??2018-06-05?22:32??experiment\build\classes\com\lyy\experimentxm
?????文件???????1138??2018-06-05?22:41??experiment\build\classes\com\lyy\experimentxm
?????文件????????808??2018-06-05?20:13??experiment\src\com\lyy\experiment\applicationContext.xm
?????文件????????199??2018-06-04?14:50??experiment\src\com\lyy\experiment\ArithmeticCalculator.java
?????文件????????537??2018-06-05?20:15??experiment\src\com\lyy\experiment\ArithmeticCalculatorImpl.java
?????文件???????2089??2018-06-05?22:54??experiment\src\com\lyy\experiment\MyAspect.java
?????文件????????876??2018-06-05?21:31??experiment\src\com\lyy\experiment\Testxm
?????文件???????1303??2018-06-05?22:48??experiment\src\com\lyy\experimentxm
?????文件????????202??2018-06-05?22:29??experiment\src\com\lyy\experimentxm
?????文件????????540??2018-06-05?22:47??experiment\src\com\lyy\experimentxm
?????文件???????1797??2018-06-05?22:32??experiment\src\com\lyy\experimentxm
............此處省略31個文件信息
評論
共有 條評論