
Spring AOP AOP(Aspect Oriented Programming) - 관점 지향 프로그래밍 AOP? Before) 흩어진 Action AAA와 BBB 똑같은 일을 수행하는 흩어진 코드들은 수정 시 모두 찾아서 다 바꿔주어야 하는 번거로움이 생김 // class A의 method a, method b는 메시지만 다를 뿐 똑같은 일을 수행 class A { method a () { AAA // AAA Action 수정시 다른 클레스 & 메서드를 다 찾아서 수정 Today is Saturday. BBB } method b () { AAA Hi, My name is Aaron. BBB } } // 다른 클래스인 class B도 마찬가지로 class A와 같은 일을 수행 class B { method..
Spring IoC 제어권이 역전된 것 !? IoC : Inversion of Control 일반적으로는 자신이 사용할 의존성을 자신이 만들어서 사용 class OwnerController { private OwnerRepository repository = new OwnerRepository(); } Spring IoC란, 자신이 사용할 의존성을 누군가 만들어 주는 것. 이것이 제어권의 역전 class OwnerController { private OwnerRepository repo; // OwnerRepository를 사용하지만 자신이 만들지 않음 // OwnerController 밖에서 누군가가 의존성을 줄 수 있도록 생성자를 통해 의존성을 받아옴 // (=제어권 역전) public OwnerCo..