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

Introduction to RIBs

Yuji Hato
March 06, 2019

Introduction to RIBs

Introduction to RIBs

Yuji Hato

March 06, 2019
Tweet

More Decks by Yuji Hato

Other Decks in Technology

Transcript

  1. Agenda 1. What are RIBs 2. Parts of RIB 3.

    Communication Between RIBs 4. RIBs Tooling 5. RIBs practice 6. Conclusion
  2. What are RIBs • େن໛ͳϞόΠϧΞϓϦέʔγϣϯ༻ʹઃܭ͞Ε͍ͯΔ • άϩʔόϧͳঢ়ଶΛ࠷খݶʹ཈͑Δ • ςετ༰қੑ •

    ੹຿ͱґଘؔ܎͕໌֬ • ΦʔϓϯɾΫϩʔζυͷݪଇ(OCP) • ϏδωεϩδοΫυϦϒϯͷtreeߏ଄ • λΠϓηʔϑ ಛ௃
  3. What are RIBs ߏ଄ • RIB tree - RIBsͰ͸ϏδωεϩδοΫͷ୯ҐͰ෼͚ͨ ʮRIBʯΛҰͭͷմͱͯ͠ѻ͏

    - RIBΛtreeߏ଄Ͱߏங͢Δ - UI֊૚ͱ͸Ұக͠ͳͯ͘Α͍ - RIBಉ࢜ʹ͸਌ࢠؔ܎͕͋Γɺґଘؔ܎͸ͦ͜ ʹ͚ͩଘࡏ͢Δ - ґଘؔ܎͕ͳ͍RIB΁͸Өڹ͠ͳ͍
  4. Parts of RIB RIB Overall • Interactor • Router •

    Builder • View(Controller) (optional) • Presenter (optional) • Component
  5. Parts of RIB Builder • RIBߏ੒ཁૉͷੜ੒ - Router - Interactor

    - View(Controller) (optional) - ࢠRIB (optional) • DI ֤ཁૉͷґଘੑͷղܾΛߦ͏
  6. Parts of RIB Presenter • DataModelͷม׵ - BusinessModel → ViewModel

    ม׵ - ViewModel → BusinessModel ม׵ - ม׵ॲཧͷTestability - RIBͷoptionalཁૉͰলུ͞Εͨ৔ ߹ɺม׵ॲཧ͸View(Controller)·ͨ ͸Interactor͕୲͏
  7. Parts of RIB Component • RIBͷґଘؔ܎Λ؅ཧ - Builderͷิॿ - ࣗ਎ͷґଘੑΛॴ༗

    - RIBΛߏங͢ΔͨΊʹඞཁͳ֎෦ґଘ΁ͷΞΫ ηε - ଞͷRIB͔ΒͷΞΫηε੍ޚ • DIྫ ࢠRIBʹґଘΛ౉ͨ͢Ίʹ਌RIBͷComponent ΛࢠRIBͷBuilderʹ஫ೖ͢Δ
  8. Parts of RIB Object references in RIB • Router -

    Interactor - View(Controller) • Interactor - Presenter - View(Controller) - weak Router • View(Controller) - weak Interactor
  9. Communication Between RIBs RIB tree downward A RIB B RIB

    C RIB • ࢠRIBͷBuilder.build()ʹύϥϝʔλͰ౉͢ • ComponentΛ༻͍ͨDIͰRx StreamsΛ౉͢
  10. Communication Between RIBs RIB tree upwards A RIB B RIB

    C RIB • ਌RIBͷInteractor͸ࢠRIBͷListenerΠϯλʔϑΣʔ εΛ࣮૷ • ࢠRIB͕ListenerΛհͯ͠਌RIBͷInteractorͷϏδω εϩδοΫΛ࣮ߦ • ਌RIB͕ࢠRIBͷRx StreamsΛ௚઀subscribe͠ͳ͍ - ϝϞϦϦʔΫΛ๷͙ - ૄ݁߹ɺtestability