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

MVVM

 MVVM

Takuma Shimizu

June 24, 2023
Tweet

More Decks by Takuma Shimizu

Other Decks in Programming

Transcript

  1. MVVMʹࢸΔ·Ͱ w 5.7& ݪॳ.7$  w .7$ w .7$ "QQMJDBUJPO.PEFM

    w ݪॳ.71 w .71 w .7$ 1SFTFOUBUJPO.PEFM w.77. w .717. w ʜ Cocoa MVC͸ग़ͯ͜ͳ͍Αʂ 👉
  2. MVC + Application Model • View - ModelؒͰͷ௚઀తͳมߋͷ؂ࢹɾ௨஌͔Β • View

    - Application Model - ModelʹΑΔؒ઀తͳ؂ࢹɾ௨஌΁ • Application Model͸Modelͱͯ͠ͷଆ໘͕ڧ͍ • View - Modelؒͷσʔλͷදݱม׵΋ߦ͏ • → ViewͷϩδοΫͱঢ়ଶͷஔ͖৔ॴͱͯ͠ػೳ
  3. MVP • View - Modelؒͷ؂ࢹɾ௨஌ͷؔ܎͕෮׆ • ౰࣌͸Passive Viewͷ֓೦͸ͳ͔ͬͨͱࢥΘΕΔ • Application

    Model͔ΒModelدΓͷཁૉ͕ෆཁʹ • → Application Model͔ΒObserverύλʔϯͷద༻͕ͳ͘ͳΓPresenter΁ ͱมԽ • Presenter͸ɺViewϩδοΫͱঢ়ଶ؅ཧʹઐ೦Ͱ͖ΔΑ͏ʹͳΓɺViewͱ ͷ࿈ܞ͕ີʹऔΕΔΑ͏ʹͳͬͨ
  4. • ViewͷϩδοΫͱঢ়ଶΛอ࣋͢ΔϞσϧ • Application Modelͱ͸ҟͳΓɺView͸௚઀อ࣋ͨ͠Γߋ৽ͨ͠Γ͠ͳ͍ • Model(υϝΠϯϨΠϠʔ)ͱ΍ΓͱΓΛߦ͏ • ViewͷมԽ͠͏Δશঢ়ଶΛอ࣋͠ɺData BindingΛ௨ͯ͡ಉظ͢Δ

    • Data Binding΁۩ମతͳݴٴ͸͋·Γ͞Ε͍ͯͳ͍ • which I'm hoping will happen some day with technologies like .NET's data binding. Presentation Model