Skip to content
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

Nhiều điểm chưa ổn về kiến trúc #1

Closed
minhtien1403 opened this issue Sep 23, 2021 · 1 comment
Closed

Nhiều điểm chưa ổn về kiến trúc #1

minhtien1403 opened this issue Sep 23, 2021 · 1 comment

Comments

@minhtien1403
Copy link

minhtien1403 commented Sep 23, 2021

  • Mình thấy bạn sử dụng VIPER nhưng mình lại k thấy P - Presenter và R - Router ở đâu trong code cả
  • Vì không có router nên bạn đang khởi tạo các màn hình trực tiếp từ viewController, điểm này cũng chưa ổn vì các màn hình cần được khởi tạo từ phía router
  • View Controller tương tác trực tiếp với interactor là sai, VC chỉ có thể tương tác vs Presenter, Presenter sẽ tương tác với những thằng khác để lấy kết quả rồi trả về cho VC
  • Mình vẫn thấy tồn tại logic if không cần thiết ở VC, VC trong viper cần ngu hết sức có thể nên cần cố gắng chuyển toàn bộ những logic như if else sang presenter
@vimask
Copy link
Owner

vimask commented Sep 23, 2021

cảm ơn bạn đã dành thời gian xem qua project.
Hiện tại mình đã tách được View và Business logic ra khỏi ViewController rồi, ViewController bây giờ chỉ làm điều hướng dữ liệu nên nó bây giờ có thể xem xét là Presenter nha bạn. The Presenter is the “traffic cop” of the architecture, directing data between the view and interactor, taking user actions and calling to router to move the user between views.
Project chưa điều hướng qua màn hình khác nên mình chưa code Router vào, sẽ bổ sung thêm vào sourcecode ạ :D

@vimask vimask closed this as completed Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants