본문 바로가기
Spring/Spring 이론 정리

[Spring] 컨테이너 / DI / AOP

by ProSeraphina 2020. 11. 18.

1. Spring Container: 사용자 정의 클래스 관리(생성, 소멸)

=ApplicationContext

=WebApplicationContext

=AnnotationConfigApplicationContext

 

2. 생성시에 필요한 데이터 전송

 DI==>setXxx(), 생성자의 매개변수

          p:          c:

 

3. AOP: 중복 제거(자동호출)

   =>시점(JoinPoint), 메소드 호출(PointCut)

 

   Aspect: 공통모듈

ex)

public MovieVO movieData(){ =>PointCut
  getConnection(); :@Before

  try{

    setAutoCommit(false) :@Around

    insert();

    update();

    commit()

  }catch(Exception ex){

    rollback(); :@Around-Throwing

  }finally{

  @After

  setAutoCommit(true) :@

   disConnection :@

  }

return ""; @After-Throwing

}

'Spring > Spring 이론 정리' 카테고리의 다른 글

[Spring] Legacy Project 생성시 기본세팅  (0) 2020.10.21

댓글