![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcOJAAg%2FbtsGurYanZQ%2Fy3nrvO1YKxrTiViEdDhPL0%2Fimg.png)
BackEnd/Spring
[Spring] @Configuration과 싱글톤 (with. CGLIB)
@Configuration public class AppConfig { @Bean public MemberService memberService() { return new MemberServiceImpl(memberRepository()); } @Bean public OrderService orderService() { return new OrderServiceImpl(memberRepository(), discountPolicy()); } @Bean public MemberRepository memberRepository() { return new MemoryMemberRepository(); } } 해당 코드는 OrderService, MemberService, MemberRepository 빈(Be..