????????AOP
????AOP??Aspect-OrientedProgramming????????????????????OOP??Object-Oriented Programing???????????????????????OOP??????????к??????????????????????ν?????????????????????????????????????????????????????????OOP????????????????????OOP?????????????μ??????????????????????????????????????????????????????????????ж??????У??????????????????????????????????????????????????簲???????????????????????????????????????????????????????У?cross-cutting????????OOP????У????????????????????????????????????????á?
??????AOP???????????????????????“????”?????????????????????????????Щ????????????????????????????????飬?????????“Aspect”???????檔??ν“????”??????????????Щ???????????????????????????????????η????????????????????????????????????????????????δ??????????????????AOP???????????????????????“????”??????????????壬???з??????????????????????????????????????·???????У?????Щ????????????????????????????????????????棬?????ν??“????”??????????????????????????Щ????????渴???????????
???????“????”??????AOP??????????????????????????????й????????????????????????????????????????????й???????й???????????????????????????????????????????????????????????????????????????????Aop ????????????????е?????????????????????й???????????????Avanade????????????????Adam Magee?????AOP??????????“????ó????е????????????????????÷?????з???”
???????AOP???????????????????????????????????????y???????????????????????Σ????????ж??????????У???????t?????????????????????????“????”?????????????????????????????й?“????”?????
????AOP??ó???
????AOP??????????й??????????????????????????:
????Authentication ???
????Caching ????
????Context passing ???????
????Error handling ??????
????Lazy loading????????
????Debugging????????
????logging?? tracing?? profiling and monitoring???????????????У?
????Performance optimization?????????
????Persistence????????
????Resource pooling???????
????Synchronization?????
????Transactions ????
????AOP??????
???????棨Aspect???????????????黯??????????????????????ж???????????????J2EE??????????????й???????????????Spring?? Advisor????????????
?????????Joinpoint??: ??????й????????????緽??????????????????????
????????Advice??: ????????????AOP?????е?????????????????????“around”??“before”??“throws”?????????????????????????AOP??????Spring??????????????????????????“Χ??”????????????????Spring?ж????????advice: BeforeAdvice?? AfterAdvice?? ThrowAdvice??DynamicIntroductionAdvice
?????????Pointcut??: ????????????????????????????????AOP??????????????????????????磬???????????? Spring??????Pointcut???????????MethodMatcher??ClassFilter?????????????????????? MethodMatcher???????????????????????????????????ClassFilter?????????Pointcut?????????????????
????????Introduction??: ??????????ε????????? Spring?????????μ?????κα???????????磬?????????????????κζ?????? IsModified???????????檔Spring??????Introduction?? ???????DelegatingIntroductionInterceptor????????????DefaultIntroductionAdvisor??????Advice??????????????
??????????Target Object??: ?????????????????????????????????POJO
????AOP?????AOP Proxy??: AOP??????????????????? ??Spring?У?AOP?????????JDK??????????CGLIB?????
???????Weaving??: ??????????????????????????????????????????????AspectJ????????????????????????ɡ?Spring????????Java AOP?????????????????????