EntryPoint 주입은 특수한 상황에서만 사용되고, 일반적인 화면(Activity/Fragment) 코딩에선 자주 쓰이지 않습니다.
@EntryPoint
@InstallIn(ApplicationComponent.class)
public interface MyEntryPoint {
MessageHelper getHelper();
}
// 시스템 컴포넌트에서 객체 추출
MyEntryPoint entryPoint = EntryPoints.get(applicationContext, MyEntryPoint.class);
MessageHelper helper = entryPoint.getHelper();
결론:
EntryPoint 주입은 “필요할 때만”, “특수 상황에서” 쓰는 실무 보조 기술이며,
일반적인 화면·비즈니스 코드 외부에서만 주로 사용됩니다[1][2][3].
대부분의 프로젝트에서는 생성자/필드 주입이 표준입니다!
출처
[1] Hilt를 사용한 종속 항목 삽입 | App architecture - Android Developers https://developer.android.com/training/dependency-injection/hilt-android?hl=ko
[2][Android] 안드로이드에서 hilt로 의존성 주입 구현하기 https://onlyfor-me-blog.tistory.com/1024
[3][Android 심화] 5주차 스터디 - 의존성 주입(DI), Hilt, Room https://dsc-sookmyung.tistory.com/620