Category: Spring
-
Domain Driven Design(DDD)
DDD 의 Aggregate 정의 필요성 특징 예시 Factory 필요성 특징 예시 Item 을 생성할 때 ItemOptionGroup, ItemOption 을 둘 다 생성해주어야 하면, 이를 Factory 내부 로직으로 숨길 수 있다 Reference
-
API 응답 체계
어떤 형태이든지 시스템 전체 API 의 응답이 명시적이고 일관된 것이 중요하다. 예시) HTTP Status Code Result Code 결과 2xx SUCCESS – 시스템에서는 이슈가 없음– 비즈니스 로직에도 이슈가 없음– Spring 에서 @ResponseStatus(HttpStatus.OK) 2xx FAIL – 시스템에서는 이슈가 없음– 비즈니스 로직에 이슈가 있음– Spring 에서 @ResponseStatus(HttpStatus.OK) 4xx FAIL – 잘못된 request 5xx…
-
의존성 역전 원칙 (Dependency Inversion Principle)
의존성 역전 원칙 Reference
-
Transaction 범위 설정
Transaction 범위 설정은 여러 번 고민하자 Transaction 내에 외부 API 를 호출하는 로직이 있는 경우 문제 해결책 Reference
-
Design Doc 작성 방법
1. 문제 정의 2. 해결 방안 3. 배포 계획 4. 타임라인 Reference
-
프로젝트 구조와 설계 – Layer 간 역할 및 구조
Layer 간 역할 및 구조 Layer 간 참조 관계에서는 단방향 의존을 유지하고 계층한 호출에서는 인터페이스를 통해 호출하도록 한다. Layer Interfaces Application Domain Infrastructure 역할 – 외부의 요청을 해석하고 Application으로부터 돌아오는 응답을 리턴하는 계층. – 서비스 전체의 시스템간 인터페이스 표준을 정의 – 트랜잭션이 유지되어야 하는 Domain 로직과 그래도 되지않는 로직을 순서에…
-
Spring Filter Bean Registration
Any Servlet or Filter beans are registered with the servlet container automatically. https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto.webserver.add-servlet-filter-listener.spring-bean As mentioned from the above Spring document, registering Servlet or Filter as a bean automatically makes those filters to be applied from the servlet container. In other words, the filters that are registered as beans will automatically be called from Spring…
-
7-1. URL 접근 보안하기
인증(Authentication) 주체(Principal)의 신원(Identity)를 증명하는 과정 인가(Authorization) 인증을 마친 유저에게 권한(Authority)를 부여하여 대상 어플리케이션의 특정 리소스에 접근할 수 있게 허가해주는 과정 스프링 시큐리티는 HTTP 요청에 서블릿 필터를 적용해 보안을 처리 AbstractSecurityWebApplicationInitializer 를 상속 WebSecurityConfigurerAdapter의 configure()를 이용 URL 접근 보안하기 가장 기본적인 스프링 시큐리티 configure() org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter#configure configure(HttpSecurity http) 메소드를 오버라이드 하면 더…
