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

VIPER with アーキテクチャ選定 実践入門 / VIPER Architecture

hirothings
January 21, 2020

VIPER with アーキテクチャ選定 実践入門 / VIPER Architecture

iOS Clean Architecture勉強会 sponsored by Sansan
https://connpass.com/event/158269/

の登壇スライドです。

hirothings

January 21, 2020
Tweet

More Decks by hirothings

Other Decks in Programming

Transcript

  1. VIPERͱ͸ʁ • View • Interactor • Presenter • Entity •

    Router ֤ϨΠϠʔͷ಄จࣈͷ૊Έ߹ΘͤͰ VIPER ͱݺͼ·͢ɻ
  2. VIPERͷಛ௃ • ΫϦʔϯΞʔΩςΫνϟΛiOSΞϓϦʹద༻ͨ͠ΞʔΩςΫ νϟ(1) • ֤ϨΠϠʔ͸Interface(Protocol)ʹґଘ • SOLIDݪଇͷ୯Ұ੹೚ͷݪଇʹجͮ͘ (1) •

    “VIPER is an application of Clean Architecture to iOS apps. “ • ग़య: https://www.objc.io/issues/13-architecture/viper/
  3. +Embedded Framework ΋ରԠ • ΞϓϦέʔγϣϯͷϞδϡʔϧ෼ׂ • ୯ํ޲ʹ͔͠ࢀরͰ͖ͳ͍ͨΊૄ݁߹ͳ࣮૷͕ڧ੍Ͱ͖Δ Embedded Frameworkͱ͸ •

    ը໘ʹؔ࿈͢ΔϨΠϠʔͱؔ࿈͠ͳ͍ϨΠϠʔͰߏ੒Λ෼͚ͨ • ը໘ʹؔ࿈͠ͳ͍ϨΠϠʔΛผϞδϡʔϧʹ෼ׂ ෼ׂͷํ਑
  4. ਖ਼͘͠෼ׂ͢Δ͜ͱΑΓը໘୯ҐͰӨڹൣғ͕ࢹ ֮తʹ෼͔ΔDXΛ༏ઌ Scene • View • Presenter • Interactor •

    Router ը໘ʹؔ࿈͠ͳ͍ϨΠϠʔ • API Request • DataStore • Entity • Utility • Components (Button..etc) "QQ ผϞδϡʔϧ
  5. ਖ਼͘͠෼ׂ͢Δ͜ͱΑΓը໘୯ҐͰӨڹൣғ͕ࢹ ֮తʹ෼͔ΔDXΛ༏ઌ Scene • View • Presenter • Interactor •

    Router ը໘ʹؔ࿈͠ͳ͍ϨΠϠʔ • API Request • DataStore • Entity • Utility • Components (Button..etc) "QQ ผϞδϡʔϧ ඍົͳϥΠϯ͕ͩ རศੑʹدͤͨՕॴ
  6. ΞʔΩςΫνϟͷબఆʹ͍ͭͯ ෳ਺"1*ϦΫΤετ ։ൃϝϯόʔ" ։ൃϝϯόʔ# ։ൃϝϯόʔ$ ϩʔΧϧ%#อଘ ଟݴޠల։ $* 2" $%

    ΞϓϦͷ੒௕ʹ߹ΘͤͯΞϓϦͷػೳɾ։ൃ؀ ڥͷෳࡶੑ͕૿͢ ։ൃϝϯόʔ% ίϯϑϦΫτ໰୊ $4ରԠ ύϑΥʔϚϯε໰୊ "#ςετ ίʔσΟϯάελΠϧ ͕όϥόϥ ΞϓϦԣల։ ։ൃϝϯόʔ&
  7. • View • Interactor • Presenter • Entity • Router

    "1*͚ͩͰ͸ͳ͘ϩʔΧϧ͔ Β΋σʔλऔಘ͢Δ૚ΛϦ ϑΝΫλϦϯά ಉ͡&OUJUZͰ΋ը໘͝ͱʹද ࣔ͢Δ಺༰͕શવҧ͏ +Model +DataStore +Translator ࣮ࡍͷϓϩδΣΫτͷվળࣄྫ Ұ෦'MVYΛಋೖ ผҊ݅