728x90
반응형
AOP(Aspect oriented programming)
흩어진 코드를 한 곳으로 모으는 것.
같은 일들을 하는 메소드들을 하나로 묶어주는것.
Class A에서 AAAA라는 일을 하고,
Class B에서 AAAA, BBBB 라는 일을 할때
별도의 class 로 묶는 것.
AOP의 예)
@Transactional = Spring AOP의 대표적인 예
다양한 AOP 구현방법
1. 컴파일
A.java ---- (AOP)----> A.class (AspectJ)
2. 바이트코드 조작
A.java --> A.class --- 클래스로더 (AOP) 메모리에서 읽어올때 조작 --> 메모리 (AspectJ)
3. 프록시패턴
디자인 패턴 중 하나로 스프링은 이 프록시패턴을 활용하여 AOP를 구현한다.
반응형
'Dev > Backend' 카테고리의 다른 글
OpenCv Java with + Spring (0) | 2020.01.23 |
---|---|
Spring PSA(Portable Service Abstraction) (0) | 2019.10.22 |
Spring IoC(Inversion of Control) (0) | 2019.10.22 |
Mybatis에서 꺽쇠( < 또는 >) 쓰는 법 (0) | 2019.07.20 |
Error configuring application listener of class org.springframework.web.context.ContextLoaderListener (0) | 2019.07.20 |