SpringFramework4 IoC, Dependency Injection Inversion of control(IoC) The approach of outsourcing the construction and management of objects Spring Container Primary fuctions Create and manage objects(Inversion of Control) Inject object dependencies(Dependency Injection) Dependency Injection The client delegates to another object the responsibility of providing its dependencies Injection types Constructor Injection Setter Injection Auto w.. 2024. 3. 12. Spring Boot Dev Tools The problem When running Spring Boot applications, If you make changes to your source code, then you have to manually restart your application. Solution : Spring Boot Dev Tools Automatically restarts your application when code is updated 1. Adding the dependency to your POM file org.springframework.boot spring-boot-devtools 2. Preferences > Build, Execution, Deployment > Complier 3. Preferences .. 2024. 3. 9. final Keyword 1. Final Classes and Methods in Spring Components Just like in regular Java classes, you might encounter the use of 'final' in Spring components. For example, a class annotated with '@Service', '@Component', or '@Repository' might have final methods to prevent them from being overridden by subclasses. This is often used to ensure that certain behaviours provided by the Spring component remain co.. 2023. 12. 2. 로깅 ■ 로깅 라이브러리 스프링 부트 라이브러리를 사용하면 스프링 부트 로킹 라이브러리(spring-boot-starter-logging) 이 함께 포함된다. 로그 라이브러리는 Logback, Log4J, Log4J2 등 많은 라이브러리가 있는데, 그것을 통합해서 인터페이스로 제공하는 것이 SLF4J 라이브러리다. // @Slf4j @RestController public class LogTestController { private final Logger log = LoggerFactory.getLogger(getClass()); @RequestMapping("/log-test") public String logTest() { String name = "Spring"; // 로그 LEVEL : TRACE > .. 2023. 2. 26. 이전 1 다음