F::d4 스프링 record 성능 향상은? 본 글은https://youtu.be/Z68yfppsBfA?si=75FhdH21pnTOE_m- 를 참고하여 작성하였습니다. 프로젝트를 진행하면서 롬복을 활용한 DTO가 아닌 record를 적용하였기 때문에 성능에 대한 고민이 있었다. 왜 record를 사용해야 하지?란 의문으로 글을 작성하게 되었다. record란?java 16에서 공개된 새로운 클래스 타입 특징불변 객체 (final 필드로 생성자 초기화 후 변경 불가, 즉 set 안됨)생성자, getter, hashCode, equals, toString 자동 제공상속 불가 @Builderpublic record MemberServiceCreateRequest( String email, String password, .. 2025. 1. 9. CORS fillter VS WebMvcConfigurer.addCorsMappings CORS fillter@Configuration@EnableWebSecurity@RequiredArgsConstructorpublic class SecurityConfig { @Bean public CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); configuration.setAllowedOrigins(List.of("http://localhost:3000")); configuration.addAllowedMethod("*"); configuration.addAllowedHeader("*"); .. 2025. 1. 2. @Bean, @Configuration 그리고 @Component @ConfigurationIndicates that a class declares one or more @Bean methods and may be processed by the Spring container to generate bean definitions and service requests for those beans at runtime @Configuration public class AppConfig { @Bean public MyBean myBean() { // instantiate, configure and return bean ... } }@ComponentIndicates that the annotated class is a component.Such.. 2025. 1. 2. [Spring boot] 환경별 YAML 생성하기(profile) YAML 파일을 분리하기로 결정한 이유1. 로컬 환경에서는 h2를, 개발 환경에서는 mysql을 사용하기 위해서2. github에 올라가면 안될 정보들을 분리하기 위해서YAML 파일들을 분리하기 위한 규칙1. 파일 이름 설정하기2. 파일 보관 장소 지정하기3. application.yml 작성하기 1. 파일 이름 설정하기Profile환경에 따라 올바른 설정파일을 읽도록 유도하는 것 application-{profile}.yml https://docs.spring.io/spring-boot/docs/2.1.9.RELEASE/reference/html/boot-features-external-config.html#boot-features-external-config-profile-specific-proper.. 2024. 12. 11. 이전 1 다음