묻고 답해요
130만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨스프링 핵심 원리 - 기본편
섹션 9 - 빈 스코프의 Singleton에서 Prototype을 사용할 때 관리주체는?
프로토타입 스코프 - 싱글톤 빈과 함께 사용시 Provider로 문제 해결위 강의에서는 Singleton Bean에서 필드 객체로 Prototype를 사용해야 할 경우를 알려주고 있는데, 이전 강의에서는 Prototype의 관리 주체는 Di를 통해 가져올 경우 Spring Container라고 했으나, 결국 Bean에서 Dependency Lookup을 통해 객체를 생성할 경우 관리 주체는 Prototype이기 때문에 개발자가 Prototype Bean의 관리주체가 된다고 했습니다. 이 때, Spring Container가 아닌 개발자가 직접 Prototype Bean을 관리한다는 것은 어떤것인지, 그리고 실제 Prototype Bean을 관리하는 상황을 몇가지 듣고싶습니다.
-
미해결자바스크립트 중고급: 엔진 핵심
__proto__ 에 대해 질문드립니다
안녕하세요 ! 강의 듣다가 질문드립니다 prototype이 상속을 위해 설정된 것이라는 건 알겠는데요 __proto__ 에 대해, 그리고 그안에 설정되는 내용에 대해 잘 이해가 안됩니다 ㅠㅠ어떤 객체로부터 상속받는지에 대한 참조..느낌일까요? 설명해주시면 감사드리겠습니다..!!
-
해결됨코어 자바스크립트
프로토타입으로 상속할때 브릿지 사용 이유
마지막 강의 뒷쪽에서 프로토타입으로 상속할 경우 브릿지 함수를 만들어서 구현하셨는데,'이름없음'이 왜 뜬다는건지 이해하지 못하여 질문드립니다.화살표를 따라가면 결국 같은 결과인데 왜 브릿지함수를 사용하지 않으면, '이름없음' 뜬다는지 이해하지 못했습니다. 답변해주시면 감사하겠습니다.
-
미해결스프링 핵심 원리 - 기본편
@Autowired에서 에러 발생
package hello.core.scope; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.Scope; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; public class SingletonWithPrototypeTest1 { @Test void prototypeFind() { AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(ClientBean.class, PrototypeBean.class); PrototypeBean prototypeBean1 = ac.getBean(PrototypeBean.class); prototypeBean1.addCount(); assertThat(prototypeBean1.getCount()).isEqualTo(1); PrototypeBean prototypeBean2 = ac.getBean(PrototypeBean.class); prototypeBean2.addCount(); assertThat(prototypeBean2.getCount()).isEqualTo(1); } @Test public void singletonClientUsePrototype() { AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext(ClientBean.class, PrototypeBean.class); ClientBean clientBean1 = ac.getBean(ClientBean.class); int count1 = clientBean1.logic(); assertThat(count1).isEqualTo(1); ClientBean clientBean2 = ac.getBean(ClientBean.class); int count2 = clientBean2.logic(); assertThat(count2).isEqualTo(2); } @Scope("singleton") static class ClientBean { private final PrototypeBean prototypeBean; @Autowired public ClientBean(PrototypeBean prototypeBean) { this.prototypeBean = prototypeBean; } public int logic() { prototypeBean.addCount(); return prototypeBean.getCount(); } } @Scope("prototype") static class PrototypeBean { private int count = 0; public void addCount() { count++; } public int getCount() { return count; } @PostConstruct public void init() { System.out.println("PrototypeBean.init " + this); } @PreDestroy public void destroy() { System.out.println("PrototypeBean.destroy"); } } } 위 코드에서 @Autowired 부분에서 Error:(43, 10) Autowired members must be defined in valid Spring bean (@Component|@Service|...)에러가 발생합니다. 스프링 빈으로 등록되어 있지 않아서 발생하는 오류라고 생각됩니다. 하지만 강사님 코드에서는 발생하지 않아서 제가 뭘 빠뜨린 것 같은데 그게 무엇인지 모르겠습니다.테스트는 돌려보면 잘 작동하고 통과가 됩니다.
-
미해결UX/UI 시작하기 : Figma 입문 (Inflearn Original)
체크박스(check box) 전체 선택
프로토타입에서 가장 상단의 체크 박스 선택시, 아래에 있는 체크박스들이 모두 선택되게 하려면 어떻게 해야하나요? 전체 프레임을 하나 통째로 생성하는 방법이외에.. 다른 방법 있을까요? 예를 들어 아래 이미지에서는 all이라는 체크 박스 선택/해제 시, Draft, In Progress, Submitted, Approved, Rejected 가 모두 일괄 선택/해제 되는 방법 있을까요?
-
미해결따라하며 배우는 노드, 리액트 시리즈 - 쇼핑몰 사이트 만들기[전체 리뉴얼]
TypeError: Cannot read property 'prototype' of undefined
안녕하세요 TypeError가 일어났는데 원인을 못 찾겠습니다.. 도와주세요ㅠㅠ console 에러는 다음과 같습니다.