Spring AOP
AOP (Aspect Oriented Programming)
Aspect : 여러 클래스에 걸쳐 있는 관심사의 모듈화.
- Java
@AspectJ 선언 클래스
- XML
<aop:config>
<aop:aspect id="myAspect" ref="aBean">
...
</aop:aspect>
</aop:config>
Join point : 메소드 실행 또는 예외 처리와 같은 프로그램 실행 중인 지점. Spring AOP에서 조인점은 항상 메서드 실행을 나타냄.
Advice : 특정 조인 포인트에서 애스펙트가 취하는 조치. 다른 타입의 "around", "before", "after" advice 포함.
Pointcut : 조인 포인트와 일치하는 조건자. Advice는 포인트컷 표현식과 연관되며 포인트컷과 일치하는 모든 조인포인트에서 실행.
- Java
@Pointcut("execution(* run(..))")
private void pointcut() {}
Pointcut designators
- execution : 메서드 실행 조인 포인트. 기본 포인트컷 지정자.
- within : <정리필요>
- this : <정리필요>
- target : <정리필요>
- args : <정리필요>
- @target : <정리필요>
- @args : <정리필요>
- @within : <정리필요>
- @annotation : <정리필요>
Introduction : <정리필요>
Target object : <정리필요>
AOP proxy : <정리필요>
Weaving : <정리필요>
참고사이트 : https://docs.spring.io/spring-framework/docs/5.3.25/reference/html/core.html#aop
Core Technologies
In the preceding scenario, using @Autowired works well and provides the desired modularity, but determining exactly where the autowired bean definitions are declared is still somewhat ambiguous. For example, as a developer looking at ServiceConfig, how do
docs.spring.io
끝.