import java.util.Map; public class ApplicationContextExtendsFindTest { AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(ConfigTest.class); @Test @DisplayName("부모타입으로 조회 시,자식이 둘 이상 있으면 중복오류가 발생한다.") void findBeanType() { Assertions.assertThrows(NoUniqueBeanDefinitionException.class, () -> ac.getBean(DiscountPolicy.class)); } @Test @DisplayName("둘 이상의 자식이 있는 경우, 빈 이름을..
@Configurable 어노테이션을 통해 스프링 컨텍스트에 빈을 등록한 후 확인하는 방법을 테스트 코드로 작성해보겠다. @Configurable public class AppConfig { @Bean public MemberService memberService(){ return new MemberServiceImpl(getMemberRepository()); } @Bean private MemberRepository getMemberRepository() { return new MemoryMemberRepository(); } @Bean public OrderService orderService(){ return new OrderServiceImpl(getMemberRepository(), getDi..
좋은 객체 지향 설계의 5가지 원칙(SOLID) SRP: 단일 책임 원칙(single responsibility principle) OCP: 개방-폐쇄 원칙(Open/closed principle) LSP: 리스코프 치환 원칙(Liskov substitution principle) ISP: 인터페이스 분리 원칙(Interface segregation principle) DIP: 의존관계 역전 원칙(Dependency inversion principle) 1. SRP: 단일 책임 원칙(single responsibility principle) 한 클래스는 하나의 책임만 가져야 한다. 하나의 책임이라는 것은 모호하다. 클 수 있고, 작을 수 있다. 문맥과 상황에 따라 다르다. 중요한 기준은 변경이다. 변경이..
- Total
- Today
- Yesterday
- 중간연산
- JPA
- 람다
- MAC
- NPM
- lambda
- 자바8
- stream
- ngnix
- elasticsearch
- install
- vscode
- 영속성 컨텍스트
- Vue
- Intellij
- ApplicationContext
- 최종연산
- Vuex
- AnnotationConfigApplicationContext
- webpack
- nginx
- container
- BeanFactory
- springboot
- docker
- 차이
- mvn
- java
- 스트림
- map
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |