[Refactor] 의존성 주입 구조 개선 및 불필요한 팩토리 메서드 제거#66
Merged
Conversation
minneee
approved these changes
Dec 16, 2025
Contributor
minneee
left a comment
There was a problem hiding this comment.
LiveDependencies 내부가 훨씬 깔끔하고 좋네요!!
# Conflicts: # SseuDamApp/Sources/Application/LiveDependencies.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 관련 이슈
✨ 작업 내용
LiveDependencies.swift에서 UseCase를 생성할 때 수동으로 Repository를 주입하던 팩토리 메서드(예:makeOAuthUseCase)를 제거하고, TCA의 의존성 관리 시스템을 활용하도록 구조를 변경했습니다.OAuthUseCase,FetchCountriesUseCase,FetchExchangeRateUseCase등에서 생성자 주입을 제거하고,@Dependency를 사용하여 내부에서 필요한 Repository에 접근하도록 수정했습니다.LiveDependencies에 명시적으로 등록하여 의존성 그래프를 명확하게 정리했습니다.OAuthUseCase.swift파일 등에서 일관되지 않았던 들여쓰기와 공백을 정리했습니다.📸 Showcase
📝 참고 사항
withDependencies를 사용하여 Mock Repository를 주입할 수 있습니다.Motivation 🥳 (코드를 추가/변경하게 된 이유)
LiveDependencies파일에서 모든 UseCase와 Repository 간의 의존 관계를 수동으로 연결해주다 보니 코드가 길어지고 관리가 어려워지는 문제가 있었습니다. TCA의 의존성 주입 시스템(Dependencies)을 더 적극적으로 활용하여 불필요한 보일러플레이트 코드를 줄이고, 유지보수성을 높이기 위해 이번 리팩토링을 진행했습니다.Key Changes 🔥 (주요 구현/변경 사항)
@Dependency사용, 코드 포맷팅FetchCountriesUseCaseProtocol.swift,FetchExchangeRateUseCaseProtocol.swift: 불필요한 코드 정리To Reviewers 🙏 (리뷰어에게 전달하고 싶은 말)
의존성 주입 로직이 변경되었으므로, 앱 실행 시 각 기능(특히 로그인, 여행 관련 기능)이 정상적으로 동작하는지 확인 부탁드립니다.
Reference 🔗
Close Issues 🔒 (닫을 Issue)
Close #No.
Checklist