Introduction to RIBs

Introduction to RIBs

Introduction to RIBs

F01523d30d0f0b7c154914a886406bc4?s=128

Yuji Hato

March 06, 2019
Tweet

Transcript

  1. 3.

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

    Communication Between RIBs 4. RIBs Tooling 5. RIBs practice 6. Conclusion
  2. 6.

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

    ੹຿ͱґଘؔ܎͕໌֬ • ΦʔϓϯɾΫϩʔζυͷݪଇ(OCP) • ϏδωεϩδοΫυϦϒϯͷtreeߏ଄ • λΠϓηʔϑ ಛ௃
  3. 7.
  4. 8.

    What are RIBs ߏ଄ • RIB tree - RIBsͰ͸ϏδωεϩδοΫͷ୯ҐͰ෼͚ͨ ʮRIBʯΛҰͭͷմͱͯ͠ѻ͏

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

    Parts of RIB RIB Overall • Interactor • Router •

    Builder • View(Controller) (optional) • Presenter (optional) • Component
  6. 14.

    Parts of RIB Builder • RIBߏ੒ཁૉͷੜ੒ - Router - Interactor

    - View(Controller) (optional) - ࢠRIB (optional) • DI ֤ཁૉͷґଘੑͷղܾΛߦ͏
  7. 16.

    Parts of RIB Presenter • DataModelͷม׵ - BusinessModel → ViewModel

    ม׵ - ViewModel → BusinessModel ม׵ - ม׵ॲཧͷTestability - RIBͷoptionalཁૉͰলུ͞Εͨ৔ ߹ɺม׵ॲཧ͸View(Controller)·ͨ ͸Interactor͕୲͏
  8. 17.

    Parts of RIB Component • RIBͷґଘؔ܎Λ؅ཧ - Builderͷิॿ - ࣗ਎ͷґଘੑΛॴ༗

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

    Parts of RIB Object references in RIB • Router -

    Interactor - View(Controller) • Interactor - Presenter - View(Controller) - weak Router • View(Controller) - weak Interactor
  10. 20.

    Communication Between RIBs RIB tree downward A RIB B RIB

    C RIB • ࢠRIBͷBuilder.build()ʹύϥϝʔλͰ౉͢ • ComponentΛ༻͍ͨDIͰRx StreamsΛ౉͢
  11. 21.

    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