-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router를 정의했습니다. #17
Router를 정의했습니다. #17
Conversation
let baseNetworkService = BaseNetworkService() | ||
let recipeFetchService = RecipeFetchServiceImpl(networkService: baseNetworkService) | ||
let feedListRepository = FeedListRepositoryImpl(networkService: recipeFetchService) | ||
let searchFeedRepository = SearchFeedRepositoryImpl(networkService: recipeFetchService) | ||
let fetchFeedListUseCase = FetchFeedListUseCaseImpl(repository: feedListRepository) | ||
let searchFeedListUseCase = SearchFeedListUseCaseImpl(repository: searchFeedRepository) | ||
let recipeListInteractor = RecipeListInteractorImpl( | ||
fetchFeedListUseCase: fetchFeedListUseCase, | ||
searchFeedListUseCase: searchFeedListUseCase | ||
) | ||
let recipeListRouter = RecipeListRouterImpl(router: self) | ||
let recipeListVC = RecipeListViewController( | ||
interactor: recipeListInteractor, | ||
router: recipeListRouter | ||
) | ||
recipeListInteractor.delegate = recipeListVC | ||
return recipeListVC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let baseNetworkService = BaseNetworkService() | |
let recipeFetchService = RecipeFetchServiceImpl(networkService: baseNetworkService) | |
let feedListRepository = FeedListRepositoryImpl(networkService: recipeFetchService) | |
let searchFeedRepository = SearchFeedRepositoryImpl(networkService: recipeFetchService) | |
let fetchFeedListUseCase = FetchFeedListUseCaseImpl(repository: feedListRepository) | |
let searchFeedListUseCase = SearchFeedListUseCaseImpl(repository: searchFeedRepository) | |
let recipeListInteractor = RecipeListInteractorImpl( | |
fetchFeedListUseCase: fetchFeedListUseCase, | |
searchFeedListUseCase: searchFeedListUseCase | |
) | |
let recipeListRouter = RecipeListRouterImpl(router: self) | |
let recipeListVC = RecipeListViewController( | |
interactor: recipeListInteractor, | |
router: recipeListRouter | |
) | |
recipeListInteractor.delegate = recipeListVC | |
return recipeListVC | |
let recipeListInteractor = RecipeListInteractorImpl( | |
fetchFeedListUseCase: FetchFeedListUseCaseImpl( | |
repository: FeedListRepositoryImpl( | |
networkService: RecipeFetchServiceImpl( | |
networkService: BaseNetworkService() | |
) | |
) | |
), | |
searchFeedListUseCase: SearchFeedListUseCaseImpl( | |
repository: SearchFeedRepositoryImpl( | |
networkService: RecipeFetchServiceImpl( | |
networkService: BaseNetworkService() | |
) | |
) | |
) | |
) | |
let recipeListRouter = RecipeListRouterImpl(router: self) | |
let recipeListVC = RecipeListViewController( | |
interactor: recipeListInteractor, | |
router: recipeListRouter | |
) | |
recipeListInteractor.delegate = recipeListVC | |
return recipeListVC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳이 상수로 갖지 않고 바로 주입해도 될 것 같아요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 코드 참고해서 다른 디펜던시들도 수정부탁드려요~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[e4b3115] 수정했습니다
} | ||
|
||
func navigateToRecipeDetail(from viewController: UIViewController, recipeID: Int) { | ||
let detailVC = router.createRecipeDetailDependencies(recipeID: recipeID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createRecipeDetailDependencies
레시피 디테일의 디펜던시를 만든다는 함수인데 VC가 리턴값인게 어색해요.
makeRecipeDetailViewController
정도로 해도 괜찮지 않을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[9c07a9b] 수정했습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create~~~~Dependencies 네이밍만 다시 고민해서 수정부탁드려요.
Quality Gate passedIssues Measures |
화면 이동, 의존성 주입을 다른 곳에서 관리하기 위해 라우터를 도입했습니다.