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

モバイルアプリ開発に使える設計の話

M.Inomata
November 16, 2018

 モバイルアプリ開発に使える設計の話

iOS/Android開発をクリーンアーキテクチャで設計、開発する話です。

M.Inomata

November 16, 2018
Tweet

More Decks by M.Inomata

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ גࣜձࣾ tech vein ୅ද ழມ ॆԝ (͍ͷ·ͨ ΈͭͻΖ) ձࣾHP:

    https://www.tech-vein.com/ private twitter: @ino2222
  2. MVVM+Clean Architecture <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU

    seCase FetchTimelineU seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource ϓϨθϯ ςʔγϣϯ૚ υϝΠϯ૚ Πϯϑϥ૚
  3. Clean Architectureͷجຊݪଇ • ΫϦʔϯͳઃܭʹ͢ΔͨΊͷϧʔϧɻ • ϏδωεϧʔϧɾσʔλΛத৺ͱͯ͠ɺUIɾAPIͳͲͷ ֎෦ΠϯλʔϑΣΠεΛϓϥάΠϯԽ͢Δɻ • ґଘؔ܎Λ̍ํ޲ʹ͢Δɻ •

    ͨͩ͠ৗʹ಺ଆ͸֎ଆΛ஌Βͳ͍Α͏ʹඞཁʹԠͯ͡ґ ଘؔ܎Λٯసͤ͞Δɻ • ૚Λ·͙ͨࢀর͸ΠϯλʔϑΣΠεΛܦ༝͢Δɻ
  4. Clean Architectureͷݪଇʁ • ݪଇ͸γϯϓϧͳϧʔϧͰɺMVʙͷΑ͏ͳɺಛఆͷΫϥεߏ੒ʹറΔ ΋ͷͰ͸ͳ͍ɻ
 ———- • ݪଇΛकΕ͹MVC, MVP, MVVM

    ͳͲ೚ҙͷΞʔΩςΫνϟͱ૊Έ߹Θ ͤͯΑ͍ɻ • Clean Architectureࣗମ͸ϋʔυ΢ΣΞ։ൃͳͲ͍͔ͳΔ։ൃͰ΋ద༻ Ͱ͖Δߟ͑ํͱͯ͠ఏএ͞Ε͍ͯΔɻ
 
 
 ˠ.77.ϕʔεͷ$MFBO"SDIJUFDUVSFΛ࠾༻
  5. Clean Architecture ͷجຊ4૚ • ֎෦ΠϯλʔϑΣΠε
 (UIͱ͔DB, APIͱ͔) • ΠϯλʔϑΣΠεΞμϓλ •

    Ϣʔεέʔε • ΤϯςΟςΟ(σʔλ)
 ͷ̐૚ɻ૚͸૿͑ͯ΋ݮͬͯ΋OK͕ͩɺ
 ґଘؔ܎͸ඞͣकΔɻ
  6. ࣗ෼ΑΓ֎૚Λ஌Βͳ͍ ˒໼ҹͷ޲͖ ґଘͷํ޲ ʹ஫໨ <Interface> TimelineReposit ory <Data> Message MessageView

    <UseCase> FetchTimelineU seCase FetchTimelineU seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource ࠨ͸ӈʹґଘ ࢀর ͍ͯ͠Δ ࠨ͸ӈΛܧঝ ࣮૷ ͍ͯ͠Δ
  7. <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU seCase FetchTimelineU

    seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource ࣗ෼ΑΓ֎૚Λ஌Βͳ͍ 6*͕஌Δੈք <Data> Message MessageView TimelineView Controller <Interface> TimelineViewM odel <Data> User UI (ExternalInterface) Entity
  8. <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU seCase FetchTimelineU

    seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource ࣗ෼ΑΓ֎૚Λ஌Βͳ͍ 7JFX.PEFM͕஌Δੈք <Data> Message <UseCase> FetchTimelineU seCase TimelineViewM odelImpl <Interface> TimelineViewM odel <Data> User ViewModel (InterfaceAdapter) Entity
  9. ࣗ෼ΑΓ֎૚Λ஌Βͳ͍ 6TF$BTF͕஌Δੈք <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU

    seCase FetchTimelineU seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource <Interface> TimelineReposit ory <Data> Message <UseCase> FetchTimelineU seCase FetchTimelineU seCaseImpl <Data> User UseCase Entity
  10. <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU seCase FetchTimelineU

    seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource ࣗ෼ΑΓ֎૚Λ஌Βͳ͍ &OUJUZ͕஌Δੈք <Data> Message <Data> User Entity
  11. <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU seCase FetchTimelineU

    seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource ಉ͡֎෦ΠϯλʔϑΣΠε૚(੨)Ͱ΋ɺ ผͷ֎෦ΠϯλʔϑΣΠεಉ࢜͸ؔ஌͠ͳ͍ 5XJUUFS"1*ΫϥΠΞϯτɾ4%,͕஌Δੈք ☓ TwitterAPICli ent / SDK <Data> TwitterMessage <Data> TwitterUser TwitterAPI&SDK (ExternalInterface)
  12. <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU seCase FetchTimelineU

    seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource ಉ͡Ξμϓλ૚(྘)Ͱ΋ɺ ผͷ֎෦ΠϯλʔϑΣΠεಉ࢜͸ؔ஌͠ͳ͍ɻ %BUB4PVSDF͕஌Δੈք ☓ <Interface> TimelineReposit ory <Data> Message TwitterAPICli ent / SDK <Data> TwitterMessage <Data> User <Data> TwitterUser Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource ΠϯλʔϑΣΠεΞμϓλͷଘࡏҙٛ͸ɺ ͋͘·Ͱಛఆͷ֎෦ΠϯλʔϑΣΠεΛ6TF$BTFͰ ѻ͑ΔΠϯλʔϑΣΠε 3FQPTJUPSZ࣮૷ ʹม׵͢Δ͜ͱʹ͋Δɻ
  13. ֎૚ʹґଘ͠ͳ͍ ֎૚ʹରͯ͠ґଘ͕ͳ͍ ʹ֎૚ͷมߋʹ͍ͭͯɺ಺૚͸҆શ <Interface> TimelineReposit ory <Data> Message MessageView <UseCase>

    FetchTimelineU seCase FetchTimelineU seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource <Interface> TimelineReposit ory <Data> Message <UseCase> FetchTimelineU seCase FetchTimelineU seCaseImpl <Data> User UseCase Entity <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU seCase FetchTimelineU seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource <Data> Message <UseCase> FetchTimelineU seCase TimelineViewM odelImpl <Interface> TimelineViewM odel <Data> User ViewModel (InterfaceAdapter) Entity
  14. ಺૚ʹ΋࠷௿ݶ͔͠ґଘ͠ͳ͍ <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU seCase

    FetchTimelineU seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource <Interface> TimelineReposit ory <Data> Message <UseCase> FetchTimelineU seCase <Interface> TimelineViewM odel <Data> User Entity ಺૚ʹରͯ͠ΠϯλʔϑΣΠεɾσʔλʹ͔͠ґଘ͠ͳ͍ ʹ಺૚ͷ಺෦มߋʹ͍ͭͯɺ֎૚΋҆શ
  15. ֎෦ΠϯλʔϑΣΠεͷมߋɾࠩ͠ସ͑ͷӨڹ ͕খ͍͞ <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU

    seCase FetchTimelineU seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource FacebookAPI Client / SDK <Data> FacebookMessa ge <Data> FacebookUser DataSource (InterfaceAdapter) FacebookAPI&SDK (ExternalInterface) FacebookAPI DataSource 5XJUUFSґଘΫϥε͕%BUB4PVSDF"1*ΫϥΠΞϯτ࣮૷಺ʹӅṭ͞Ε͍ͯΔͷͰɺ 5XJUUFSˠ'BDFCPPLʹมΘͬͯ΋ɺଞͷ૚ͷΫϥεΛҰ੾ม͑ͳͯ͘Α͍ɻ Өڹൣғ͸͚ͩ͜͜ʂˠ
  16. <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU seCase FetchTimelineU

    seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource ϏδωεϩδοΫͷมߋ͕ ֎෦ΠϯλʔϑΣΠεɾUIʹӨڹ͠ͳ͍ ͨͱ͑͹ɺλΠϜϥΠϯͷϧʔϧɾ৚݅Λදࣔ͢ΔͳͲɻ ࣮૷ࡁ3FQPTJUPSZͷ૊Έ߹ΘͤͰࡁΉͳΒɺ%BUB4PVSDF"1* 4%, ҎԼ͸มߋෆཁɻ ݟͨ໨ͷมߋ͕ཁΒͳ͍ͳΒɺ7JFX.PEFM6*΋มߋෆཁɻ
  17. <Interface> TimelineReposit ory <Data> Message MessageView <UseCase> FetchTimelineU seCase FetchTimelineU

    seCaseImpl TimelineView Controller TimelineViewM odelImpl TwitterAPICli ent / SDK <Interface> TimelineViewM odel <Data> TwitterMessage <Data> User <Data> TwitterUser UI (ExternalInterface) ViewModel (InterfaceAdapter) UseCase Entity DataSource (InterfaceAdapter) TwitterAPI&SDK (ExternalInterface) TwitterAPIDat aSource TimelineDetailV iewModelImpl <Interface> TimelineDetailV iewModel TimelineDetail ViewController UIͷมߋ͕ ϏδωεϩδοΫɾσʔλ΍֎෦ΠϯλʔϑΣΠε ʹґଘ͠ͳ͍ ͨͱ͑͹ɺλΠϜϥΠϯͷݟͨ໨ͷมߋ΍ɺৄࡉը໘௥ՃͳͲɻ طଘ6TF$BTF͚ͩͰ࣮ݱͰ͖ΔͳΒɺϓϨθϯ૚ͷมߋ͚ͩͰࡁΉɻ
  18. ΫϦʔϯΞʔΩςΫνϟͷΩϞ ੍ޚͷ൓స(Inversion of Control) • ͜ΕͩͱɺϏδωεϩδοΫ͕֎෦ΠϯλʔϑΣΠε΍UIʹґଘͯ͠͠·͍ɺΫϦʔϯΞʔΩς ΫνϟͷઃܭϧʔϧΛकΕͳ͍ͷͰ͜͏͍ͨ͠ɻ TimelineViewM odel TimelineView

    Controller FetchTimelineU seCase TwitterAPIDat aSource TwitterAPICli ent / SDK ґଘͷ޲͖Λ൓స͍ͨ͠ ⇛ͦ͜Ͱ੍ޚͷ൓స *P$ Λ׆༻͢Δʂ TimelineViewM odel TimelineView Controller FetchTimelineU seCase TwitterAPIDat aSource TwitterAPICli ent / SDK ͜͏ͳΔ • ૉ௚ʹ࣮૷͢ΔͱɺॲཧͷྲྀΕʹґଘؔ܎ʹͳΔɻ
  19. ੍ޚͷ൓స FetchTimelineU seCaseImpl TwitterAPIDat aSource FetchTimelineU seCaseImpl FetchTimelineR epository TwitterAPIDat

    aSource ͜Ε͕ɺ ͜͏ͳͬͨʂ %BUB4PVSDFΛ஌Βͳ͍ ˠ5XJUUFS"1*%BUB4PVSDF͕ ೖΕସΘͬͯ΋ؾ͔ͮͳ͍ʂ
  20. RxͰඇಉظॲཧͱଟஈॲཧΛָʹ ͢Δ • Rx=Reactive Extension
 ඇಉظॲཧͱಉظॲཧΛ۠ผͤͣετϦʔϜͱͯ͠εϚʔ τʹѻ͑ΔΑ͏ʹͳΔϥΠϒϥϦ(RxSwift / RxJava)ɻ •

    ΫϦʔϯΞʔΩςΫνϟͷઃܭࢥ૝ͷϏδωεϩδοΫ ʹʮ؀ڥ΍ϥΠϒϥϦ΁ͷґଘΛͳ͘͢ʯͱ͸൓͠· ͕͢ɺ֤૚ͷग़ྗͱͯ͠RxΛ࢖͏ͱ࣮૷ָ͕ʹͳΔͨ ΊΑ͘ར༻͍ͯ͠·͢ɻ
 ʢಛʹඇಉظपΓͱ֤૚Ͱͷσʔλม׵ॲཧָ͕ʣ
  21. RxΛ࢖ͬͨྫ View͔ΒAPIऔಘͯ݁͠ՌΛදࣔ͢Δ·Ͱ TimelineViewM odel TimelineView Controller FetchTimelineU seCase TwitterAPIDat aSource

    TwitterAPICli ent / SDK ը໘ϩʔυΠϕϯτ onLoad() execute() -> Observable<[Message]> fetchTimeline() -> Observable<[Message]> request() -> TwitterResponse response から Observable<[Message]> に 変換して結果を流す ObservableΛ ͦͷ··SFUVSO UJNFMJOFTϓϩύςΟΛ ؂ࢹͯ͠6*࠶ඳը MFUUJNFMJOFT0CTFSWBCMF<.FTTBHF> ϓϩύςΟʹ݁ՌΛྲྀ͢ λΠϜϥΠϯऔಘͰ͖ͨΒ responseΛฦ͢
  22. ͍͞͝ʹ • tech vein Ͱ͸͜ΜͳΞϓϦΤϯδχΞɺ
 ϑϦʔϥϯεɾύʔτφʔ༷Λืू͍ͯ͠·͢ɻ • RxSwift, RxJava Λ࢖͍͍ͨ

    • MVVMɺ CleanArchitectureɺ DI Λ׆༻ͨ͠ઃܭʹڵຯ͕͋Δ ڵຯ͕͋Δํɺͪΐͬͱ࿩Λฉ͍ͯΈ͍ͨํ
 ͨͩઃܭͷ࿩Λ΋ͬͱฉ͖͍ͨํ΋
 ͥͻ͓੠͕͚Լ͍͞ʂ
  23. ิ଍:ଞͷΞʔΩςΫνϟͱClean Architecture ͷ૊Έ߹Θͤʹ͍ͭͯ • ϓϨθϯςʔγϣϯ૚͸UI+ViewModel͚ͩͰઆ໌͠·͕ͨ͠ɺΫϦʔϯ ΞʔΩςΫνϟͰ͸റΓ͕ͳ͍෦෼ͳͷͰɺγεςϜن໛΍։ൃϝϯόʔ͕ ׳Ε͍ͯΔΞʔΩςΫνϟʹΑͬͯࣗ༝ʹબ୒ͯ͠΋͍͍ͱࢥ͍·͢ɻ • ྫɿ
 େن໛…ViewModel͸σʔλ͚ͩʹͯ͠ɺPresenterΛ༻ҙ͢Δ(Viper)


    தن໛…ViewModelΛ࢖ΘͣɺPresenter͚ͩ(MVP+CleanArchitecture)
 খن໛…ViewModel΋Presenter΋࢖Θͳ͍(M+VC+CleanArchitecture) • ·ͨɺViewModel͸Interfaceͱ͠·͕ͨ͠ɺUIมߋʹӨڹΛड͚͍͍ͯͷ Ͱ͋Ε͹ɺViewModel͸ΠϯλʔϑΣΠεԽͤͣɺ࣮ମͷΈͰ΋ྑ͍ͱࢥ͍ ·͢ɻ(ϓϨθϯ૚Λ̎૚Ͱͳ̍͘૚͚ͩͱΈͳ͢)
  24. ิ଍:Ϋϥεͷ໾ׂʢυϝΠϯ૚ʣ • UseCase
 ݸ਺ɿ̍ػೳ̍Ϋϥεɻ
 ໾ׂɿ̍ͭͷػೳΛ࣮ݱ͢Δ(ྫɿձһొ࿥͢Δɺ͓ؾʹೖΓ௥Ճ͢Δ) • Repository
 ݸ਺ɿػೳΛߏ੒͢Δཁૉ܈ΛάϧʔϓԽͱͯ͠ɺ̍άϧʔϓ̍Ϋϥεɻ
 ໾ׂɿUseCaseͷߏ੒ཁૉΛఏڙ͢Δɻ
 ྫɿձһ৘ใϦϙδτϦ…ձһ৘ใΛ࡞੒

    / ߋ৽ / ࡟আ͢Δ
 λΠϜϥΠϯϦϙδτϦ…λΠϜϥΠϯϦετऔಘɺݕࡧ৚݅ΛߜͬͯϦετऔಘɺ͓ؾʹೖΓ ϝοηʔδొ࿥/࡟আ
 ϝοηʔδ౤ߘϦϙδτϦ…ϝοηʔδૹ৴/࡟আɺDMૹ৴/࡟আ • ModelΦϒδΣΫτ(σʔλ)
 ݸ਺ɿ̍σʔλ୯Ґ̍Ϋϥε
 ໾ׂɿϝοηʔδɺϢʔβͳͲͷσʔλΛ΋ͭγϯϓϧͳΦϒδΣΫτɻσʔλՃ޻ͷͨΊͷ؆୯ͳϝ ιουΛ࣋ͭ͜ͱ΋ɻ
  25. ิ଍ɿਤͰDataSource͕̎৭ʹ ͳ͍ͬͯͨͷ͕ؾʹͳΔ • ͜ͷDataSource͸֎෦ΠϯλʔϑΣΠε(੨)Λ஌ͬͯ͠·͍ͬͯΔՄೳੑ͕͋ΔͨΊɺ InterfaceAdapterͳ͠ͷ֎෦ΠϯλʔϑΣΠεͷΑ͏ͳҐஔ͚ͮʹͳΔͱߟ͑ศ্ٓ̎৭Ͱද͍ͯ͠· ͢ɻ • ࣮ࡍʹ͸TwitterAPIClientͳͲ͕ϥΠϒϥϦʹΑͬͯந৅Խ͞Ε͍ͯΔ৔߹΋͋Γɺͦ͜ʹΠϯλʔϑΣ ΠεΛ଍͢ͱ৑௕ʹͳΓ·͢͠ɺͦ͏Ͱͳ͍৔߹΋ϏδωεϩδοΫͱ͸RepositoryΠϯλʔϑΣΠε Ͱ҆શʹ੾Γ཭͞Ε͍ͯΔͨΊɺ͜͜Ͱ͸ඞͣ͠΋ΠϯλʔϑΣΠεΛ৽ͨʹ༻ҙ͢Δඞཁ͸ͳ͍ͱߟ

    ͍͑ͯ·͢ɻ • ̐૚Ͱ࣮૷͢ΔͳΒDataSource͸ΠϯλʔϑΣΠεΞμϓλ(྘)Ͱ͢ͷͰɺTwitterAPIClientͷinterface Λ༻ҙ͢Ε͹֎෦ΠϯλʔϑΣΠε(੨)Λ஌Βͳͯ͘΋Α͘ͳΓ·͢ɻ • ৗʹ෼཭͢Δͱ֎෦ΠϯλʔϑΣΠε༻ͷσʔλܕͷӅṭ΋ඞཁͳͷͰେมͰ͕͢ɺDataSource͕ෳ ࡶʹͳ͖ͬͯͯɺ֎෦ΠϯλʔϑΣΠεͱͷґଘΛബͨ͘͘͠ͳͬͨΒ෼཭͢Δ΄͏͕͍͍Ͱ͠ΐ͏ɻ DataSource (InterfaceAdapter) TwitterAPIDat aSource