Spring Framework 4

Spring

Java 기반의 오픈 소스 애플리케이션 프레임워크로, 엔터프라이즈급 애플리케이션을 빌드하기 위한 다양한 모듈과 기능을 제공 IoC 컨테이너 (Inversion of Control Container) IoC 컨테이너는 객체의 생성, 의존성 주입 및 라이프사이클 관리를 담당 @Component, @Service, @Repository 등의 어노테이션을 사용하여 클래스를 Bean으로 등록하고, 의존성 주입(Dependency Injection)을 통해 객체 간의 관계를 설정 @Component public class MyService { private final MyRepository repository; @Autowired public MyService(MyRepository repository) { thi..

learn/framework 2023.09.22

어노테이션(Annotation) - 의존성 주입(Dependency Injection) 관련

의존성 주입(Dependency Injection) 관련 @Autowired 의존성 주입(Dependency Injection)을 수행 필드 주입(Field Injection) 생성자 주입(Constructor Injection) Setter 메서드 주입(Setter Method Injection) //필드 주입(Field Injection) @Service public class UserService { @Autowired private UserRepository userRepository; // ... } //생성자 주입(Constructor Injection) @Service public class UserService { private final UserRepository userRepositor..

learn/spring 2023.09.21

빈 (Bean)

빈 (Bean) Spring에서 애플리케이션의 핵심을 이루고 Spring IoC 컨테이너에 의해 관리되는 객체를 빈(Bean)이라 함. 빈은 Spring IoC 컨테이너에 의해 인스턴스화되고 조립되며 관리되는 객체임. In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container. Java 클래스를 Bean으로 선언하기 위해 @Component, @Ser..

learn/spring 2023.09.21

스프링 컨테이너 (Spring Container)

스프링 컨테이너 (Spring Container) 스프링 컨테이너는 Spring에서 빈(Bean)들의 생명주기를 관리하는 Spring Framework의 코어(Core)이다. The Spring container is the core of the Spring Framework, responsible for managing the lifecycle of beans and facilitating dependency injection. Bean 객체의 생성과 소멸 관리 Bean 객체 간의 의존성 주입(Dependency Injection) 설정 정보를 통한 Bean 객체의 설정과 구성 Bean을 Singleton으로 관리하므로 여러 곳에서 동일한 Bean 인스턴스를 공유 AOP를 통해 관점 지향 프로그래밍을 ..

learn/spring 2023.09.19