-
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
[7차 세미나] 리펙토링 #8
base: main
Are you sure you want to change the base?
Conversation
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.
역시 오비는 다르다..!!!! 의존성 분리를 너무 잘해놓으셔서 눈호강 하고 갑니다
오늘도 행복하세요 :)
|
||
import Foundation | ||
|
||
final class AppDIContainer { |
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.
와! 의존성분리를 하시다니 진짜 본격적으로 하셧군요! 역시 빡고수,,
init(viewModel: MainContentViewModel) { | ||
self.viewModel = viewModel | ||
super.init(nibName: nil, bundle: nil) | ||
} |
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.
의존성 주입에 기립박수치고갑니다
requestDetailInfo(code: code) { [weak self] detailData in | ||
let detailViewController = DetailViewController() | ||
detailViewController.detailView.configure(with: detailData) | ||
private func bindViewModel() { |
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.
의존성을 잘 분리하셧는데 이부분도 분리한김에 Coordinator 패턴을 적용해서 화면 리로드를 가져가봐도 좋을것같아요..! 츄라이츄라이
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.
MVVM도 적용하고 과제 하시느라 고생하셨어요!! PR도 자세히 적으셔서 이해하기 수월했습니다!! 쵝오 💪
@@ -10,16 +10,19 @@ import UIKit | |||
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |||
|
|||
var window: UIWindow? | |||
|
|||
let appDIContainer = AppDIContainer() |
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.
의존성 분리 수고하셨습니다!!
import Foundation | ||
|
||
protocol ContentRepository { | ||
func getMovieInfo(completion: @escaping (Result<[Content], Error>) -> Void) | ||
func getDetailInfo(code: String, completion: @escaping (Result<ContentDetail, Error>) -> Void) | ||
} |
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.
프로토콜 선언은 이렇게 하는거군요! 잘 보고 갑니다 :)
👾 작업 내용
Domain
→ 프로젝트가 무엇으로 바뀌든, 이 부분이 존재함은 절대 변함이 없기 때문에 이렇게 정의 했어요!
Domain은 Data 영역에 의존관계를 가지면 안됩니다.
Repository에 대한의존을 가지면 안됩니다!
따라서 protocol로 선언하여 의존성을 역전시켜줍니다.
Data
Presentation
SceneDelegate
🚀 PR Point
🔗 Issue
Resolved #7