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 | 29 | 30 | 31 |
Tags
- 이펙티브 자바
- springboot
- deleteById
- Item04
- Firebase
- @Valid
- @MockBean
- JPA
- Service Locator
- 데이터베이스
- restTemplate
- Web
- NotEmpty
- @SpyBean
- 트랜잭션
- Effetive Java
- SQL 삽입 공격
- 플라이웨이트
- Effective Java
- FCM
- Spring Boot
- Proxy Patter
- NotBlank
- 디자인 패턴
- Service Locator 패턴
- Connection Pool
- multi module
- @ControllerAdvice
- java
- db
Archives
- Today
- Total
목록dependency (1)
NoTimeForDawdling

Spring Boot에서 의존성 주입 방법으로 3가지가 있습니다. 지금부터 스프링의 의존성 주입 방법에 대해서 알아보겠습니다. 1. 생성자 주입(Constructor Injection) 생성자 주입 방법은 Spring framework reference에서 가장 권장하는 방법입니다. @Service public class SampleService { private final SampleRepository sampleRepository; @Autowired public SampleService(SampleRepository sampleRepository) { this.sampleRepository = sampleRepository; } } 생성자에 @Autowired 애너테이션을 붙여 의존성을 주입받을 수..
SpringBoot
2021. 3. 25. 15:10