Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MVC-MVVM-MVVMC Sharing

Huiqin
September 22, 2019

MVC-MVVM-MVVMC Sharing

本次主題會介紹MVC的開發,並提及MVVM架構的設計及其解決的問題,最後會再切入MVVMC,進一步了解它想解決哪一些問題。基於產品的維護性、可讀性、可測試性等來分析架構的理念及重要性,再來就是一些實戰經驗分享。個人認為重要的不是學習這些架構而是它們解決的問題和理念,從中了解並思考為什麼要這樣設計。

Huiqin

September 22, 2019
Tweet

More Decks by Huiqin

Other Decks in Programming

Transcript

  1. 簡介 • MVC介紹 → 常犯的問題 → 如何避免和維護 • MVVM解決什麼 →

    實戰⼼得 → 優化 • MVVMC再進化 → 實戰⼼得 → 要注意的坑
  2. Controller 背負的責任 Fetch models Views layout Business Logic Routing Logic

    Selectors (Handle actions) Miscellaneous (Location, Map, Event…) Delegates
  3. View Controller View Business Logic Account State MVC 寫測試遇到瓶頸 Controller

    會帶⼀些我們 不需要的Code Business Logic 有可能被 其他View/Object影響 …
  4. Controller 背負的責任 Fetch models Views layout Business Logic Routing Logic

    Selectors (Handle actions) Miscellaneous (Location, Map, Event…) Delegates
  5. Unit Test Controller Business Logic Account State ViewModel View …

    就有理由不⽤寫 Controller的單元測試
  6. Model View Controller MVC MVVM Model ViewModel View
 (Controller) MVVMC

    Model ViewModel View
 (Controller) Coordinator
  7. References Follow Green • Github: @Greenchiu , Twitter: @handkid Kickstarter

    Inputs/Outputs Protocol • https://github.com/kickstarter/native-docs/blob/master/ vm-structure.md 想要了解更多MVVMC實作,可以參考我的練習 • https://github.com/nghuiqin/Todo-RxSwift-MVVMC/