Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Spring
- Springsecurity
- annotation
- DynamoDB
- javaspring
- EmbeddedId
- AWS
- filterexpression
- MockMvc
- 다이나모디비
- Route53
- partiql
- testresttemplate
- 스프링
- awscli
- 자바
- secondaryindex
- 도메인
- Java
- 오류
- IdClass
- query
- 로드밸런서
- 스프링테스트
- compositekey
- markerinterface
- awscloud
- 자바스프링
- 테스트코드
- 개발
Archives
- Today
- Total
목록Programming (1)
아장아장 개발 일기
@Component VS @Service VS @Repository 어노테이션 차이
스프링 클래스를 빈등록 할때면 component, service, repository 어노테이션 중 어떤 걸 써야할지 헷갈렸습니다. repository는 비교적 다른 두개와 구분하기 쉬웠는데, component와 service 어노테이션이 특히 헷갈리더라구요. 이번에 baeldung에서 셋의 차이를 간략하게 다룬 글을 찾아서 한번 정리해보았습니다. @Component 1. 스프링이 관리하는 컴포넌트로 등록됨 2. 스프링은 @Component로 등록된 bean만 인식함3. @Service와 @Repository도 @Component 어노테이션을 포함하기때문에 ApplicationContext로 등록됨. @Repository 1. 특정 persistence에 맞는 예외를 찾고 스프링의 일원화된 체크 되지 않..
개발/Spring
2022. 8. 18. 16:53