RIBs 是 Router、Interactor 和 Builder 的简称,是 Uber 许多移动端应用背后的跨平台架构。
RIBs 主要特性:
iOS 和 Android 可共享架构。构建架构类似的跨平台应用程序,使 iOS 和 Android 团队能够交叉审查业务逻辑代码。
可测性和隔离。类极易单独测试和隔理。不同的 RIB 类肩负不同的职责,如:路由、业务、查看逻辑、创建。
高效率开发。RIB 与 IDE 工具一起提供代码生成、内存泄漏检测、静态分析和运行时集成等,以提高开发人员生产力。
高度可扩展。该架构已被证明可支持数百名工程师使用数百个 RIBs 同时工作在相同的代码库和应用上。
Android 端安装方式:
To integrate the recommended minimum setup for RIBs add the following to your build.gradle
:
dependencies { annotationProcessor 'com.uber.rib:rib-compiler-test:0.9.1' compile 'com.uber.rib:rib-android:0.9.1' testCompile 'com.uber.rib:rib-test-utils:0.9.1' }
iOS 端安装方式:
CocoaPods:To integrate RIBs into your project add the following to your Podfile
pod 'RIBs', '~> 0.9'
Carthage:To integrate RIBs into your project using Carthage add the following to your Cartfile
github "uber/RIBs" ~> 0.9
评论