스터디/혜림 (1) 썸네일형 리스트형 @bean 과 @component 의 차이 스프링 MVC에서는 @Controller, @Service, @REpository 등으로 빈을 등록할 수 있다.configuration 관련 객체들은 @Bean 과 @Component 로 스프링 컨테이너에 객체를 빈으로 등록 할 수 있다.@Bean반환되는 객체(인스턴스)를 개발자가 수동으로 빈 등록@Configurationpublic class AppConfig { @Bean public MemberService memberService() { return new MemberServiceImpl(); }}@Component스프링이 런타임시 componet 를 스캔해 자동으로 빈을 찾고 등록@Componentpublic class Utility { // .. 이전 1 다음