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

最適な設計でアプリを作る

 最適な設計でアプリを作る

CAMPFIRE iOS #1での発表資料です。
https://yj-meetup.connpass.com/event/51735/
#yjcamp

Tatsuya Tanaka

March 16, 2017
Tweet

More Decks by Tatsuya Tanaka

Other Decks in Technology

Transcript

  1. • Yahoo!৐׵Ҋ಺ • iOSΞϓϦΤϯδχΞ • 2016೥৽ଔ • Github: @tattn •

    Qiita: @tattn • Twitter: @tanakasan2525 ాத ୡ໵
  2. try! Swift ʹߦ͖ͬͯ·ͨ͠ Yahoo! JAPAN Tech Blog https://techblog.yahoo.co.jp/ try! Swift

    Tokyo 2017 ʹڠࢍ͠·ͨ͠ https://techblog.yahoo.co.jp/ios/try_swift_2017/ try! Swift Tokyo 2017 ͷϋοΧιϯʹࢀՃ͠·ͨ͠ https://techblog.yahoo.co.jp/ios/try_swift_2017_hack/
  3. σʔλϨΠϠΛ෼཭͢Δ Minimum
 Viable
 Architecture https://www.slideshare.net/RandyShoup/minimum-viable- architecture-good-enough-is-good-enough-in-a-startup Minimum Viable Architecture 


    -- Good Enough is Good Enough in a Startup http://www.kavistechnology.com/blog/minimal-viable-architecture/ “ඞཁ࠷খݶΞʔΩςΫνϟ”
  4. “What we need is a balance of speed to market

    and architecture. What we need is a Minimal Viable Architecture (MVA).” — Randy Shoup ࢲ͕ͨͪඞཁͱ͍ͯ͠Δͷ͸ • ࢢ৔౤ೖͷεϐʔυͱΞʔΩςΫνϟͷόϥϯεͩɻ • ඞཁ࠷খݶͷΞʔΩςΫνϟͩɻ ελʔτΞοϓͰͳ͘ͱ΋ಉ͜͡ͱ͕ݴ͑Δ͸ͣ
  5. protocol FeedRepositoryOutput: class { func receive(feeds: [Feed]) } class FeedRepository:

    FeedDataStoreOutput { private let dataStore: FeedDataStore weak var output: FeedRepositoryOutput? init(dataStore: FeedDataStore, output: FeedRepositoryOutput?) { … } func getFeeds() { dataStore.getFeeds() } } extension FeedRepository: FeedDataStoreOutput { func receive(feeds: [Feed]) { output?.receive(feeds: feeds) } } Repository patternͷྫ
  6. Clean ArchitectureΛಋೖ͍ͯ͠ͳ͚Ε͹ Swift × I/F = Protocol protocol FeedRepository {

    var output: FeedRepositoryOutput? { get set } func getFeeds() } extension FeedDataStore: FeedRepository { … } ※ͦ΋ͦ΋͜Μͳ͜ͱ͸͠ͳ͍͸ͣͳͷͰগ͠ແ஡ͳྫͰ͢ɻ
  7. ઃܭ͸ڞ௨ݴޠ ઃܭ͸ ϓϩδΣΫτͷڞ௨ݴޠ (ͪͳΈʹɺClean ArchitectureͷఏএऀͷRobert Martin͸
 ઃܭ͸ “Intent (ҙਤ)” ͩͱߟ͍͑ͯΔΑ͏Ͱ͢)

    ϝϯόʔ͕ೲಘ͢Δઃܭʹ͢Δͷ΋େࣄ https://www.infoq.com/news/2013/07/architecture_intent_frameworks
  8. ࣮ࡍʹ౰ͯ͸Ίͯߟ͑ͯΈΔ struct MyApp: MVP { … } struct MyApp: Flux

    { … } struct MyApp: CleanArchitecture { … } struct MyApp: MVVM, VIPER {} ΋͔͢͠Δͱ
 ͦͷΞϓϦʹ͸͜Ε͕Ϛον͢Δ͔΋ʁ