A circular dependency occurs when two classes depend on each other. For example, class A needs class B, and class B also needs class A. Circular dependencies can arise in Nest between modules and between providers.
While circular dependencies should be avoided where possible, you can't always do so. In such cases, Nest enables resolving circular dependencies between providers in two ways. In this chapter, we describe using forward referencing as one technique, and using the ModuleRef class to retrieve a provider instance from the DI container as another.
We also describe resolving circular dependencies between modules.
순환 종속성순환 종속성은 두 클래스가 서로 의존 할 때 발생합니다. 예를 들어, 클래스 A에는 클래스 B가 필요하고 클래스 B에는 클래스 A도 필요합니다. 순환 종속성은 모듈 간 및 공급자간에 Nest에서 발생할 수 있습니다.
순환 종속성은 가능한 한 피해야하지만 항상 그렇게 할 수는 없습니다. 이러한 경우 Nest는 두 가지 방법으로 공급자 간의 순환 종속성을 해결할 수 있습니다. 이 장에서는 순방향 참조 를 하나의 기술로 사용하고 ModuleRef 클래스를 사용 하여 DI 컨테이너에서 공급자 인스턴스를 다른 기술 로 검색하는 방법을 설명합니다.
또한 모듈 간의 순환 종속성 해결에 대해서도 설명합니다.
/////////////////////
뭐냐 ?? 원래 한국어로 쓴거 같잖아 ㅋㅋ 쩌는데
댓글 0