Framework & Library/Spring Boot
-
Spring Boot - IoC와 DIFramework & Library/Spring Boot 2021. 9. 23. 17:54
IoC(Inversion of Cotainer) IoC란? - IoC는 Inversoin of Container의 약자로, 제어의 역전이란 의미를 가지고 있다. - 제어의 역전이란 객체의 생명주기 관리를 컨테이너가 도맡아, 제어권이 개발자에서 컨테이너로 넘어가게 되어 제어권의 흐름이 바뀌었다는 것을 뜻한다. - 즉, 개발자가 직접 new 키워드를 통해 인스턴스를 생성하고, 메서드를 호출하는 작업들을 스프링에 위임하는 것이다. DI(Dependency Injection) DI란? - DI란 의존 관계 주입이라 하고, 어떤 객체가 사용하는 의존 객체를 내부에서 직접 생성하는 것이 아니라 외부에서 주입하는 방식을 말한다. DI의 사용 이유 - 객체를 주입받는다는 것은 외부에서 생성한 객체를 넘겨받는 것이기 때..
-
Spring Boot - 스프링 웹 개발 기초Framework & Library/Spring Boot 2021. 9. 23. 17:49
정적 콘텐츠의 동작 과정 1. 웹 브라우저 요청 ex) localhost:8080/hello-static.html 2. 내장 톰캣 서버에서 콘텐츠 탐색 2-1. 우선, 스프링 컨테이너에 접근 → hello-static 관련 컨트롤러가 존재하지 않음 2-2. static 폴더에 접근 → hello-static.html 파일이 존재 3. 브라우저에 hello-static.html 파일을 렌더링 MVC와 템플릿 엔진의 동작 과정 1. 웹 브라우저 요청 ex) localhost:8080/hello-mvc?name=spring 2. 내장 톰캣 서버에서 콘텐츠 탐색 2-1. 스프링 컨테이너에 접근 → 해당 url과 매핑된 컨트롤러가 존재 2-2. 모델이 전달받은 데이터를 처리한 후, 템플릿 이름을 반환 2-3. v..