-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
questionFurther information is requestedFurther information is requested
Description
토비의 스프링 114p, 119p에 따르면 DI의 조건으로 구체 클레스가 아닌 인터페이스에 의존하고 있어야한다고 말한다.
114p: 클래스 모델이나 코드에는 런타임 시점의 의존관계가 드러나지 않는다. 그러기 위해서는 인터페이스에만 의존하고 있어야 한다
119p: DI에서 말하는 주입은 다이내믹하게 구현 클래스를 결정해서 제공받을 수 있도록 인터페이스 타입의 파라미터를 통해 이뤄져야 한다
그러면 우리가 사용하는 Controller, Service 등 하나의 구체 클래스를 만들어 의존 주입하는 경우는 DI라고 말할 수 없는 걸까?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested