• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

uber/RIBs: Uber's cross-platform mobile architecture framework.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

uber/RIBs

开源软件地址(OpenSource Url):

https://github.com/uber/RIBs

开源编程语言(OpenSource Language):

Kotlin 34.0%

开源软件介绍(OpenSource Introduction):

RIBs

Android CI License Maven Central Cocoapods Compatible Carthage Compatible

RIBs is the cross-platform architecture framework behind many mobile apps at Uber. The name RIBs is short for Router, Interactor and Builder, which are core components of this architecture. This framework is designed for mobile apps with a large number of engineers and nested states.

The RIBs architecture provides:

  • Shared architecture across iOS and Android. Build cross-platform apps that have similar architecture, enabling iOS and Android teams to cross-review business logic code.
  • Testability and Isolation. Classes must be easy to unit test and reason about in isolation. Individual RIB classes have distinct responsibilities like: routing, business, view logic, creation. Plus, most RIB logic is decoupled from child RIB logic. This makes RIB classes easy to test and reason about independently.
  • Tooling for developer productivity. RIBs come with IDE tooling around code generation, memory leak detection, static analysis and runtime integrations - all which improve developer productivity for large teams or small.
  • An architecture that scales. This architecture has proven to scale to hundreds of engineers working on the same codebase and apps with hundreds of RIBs.

Documentation

To get started with RIBs, please refer to the RIBs documentation. This describes key concepts on RIBs, from what they are for, their structure and common use cases.

To get more hands on with RIBs, we have written a series of tutorials that run you through the main aspects of the architecture with hands-on examples.

To read about the backstory on why we created RIBs, see this blog post we wrote when releasing RIBs in production the first time and see this short video where we discussed how the RIBs architecture works.

What is the difference between RIBs and MV*/VIPER?

MVC, MVP, MVI, MVVM and VIPER are architecture patterns. RIBs is a framework. What differentiates RIBs from frameworks based on MV*/VIPER is:

  • Business logic drives the app, not the view tree. Unlike with MV*/VIPER, a RIB does not have to have a view. This means that the app hierarchy is driven by the business logic, not the view tree.
  • Independent business logic and view trees. RIBs decouple how the business logic scopes are structured from view hierarchies. This allows the application to have a deep business logic tree, isolating business logic nodes, while maintaining a shallow view hierarchy making layouts, animations and transitions easy.

There are some other novel things about RIBs. However, these could also be implemented with other MV*/VIPER frameworks. These are:

  • Cross-platform approach, allowing iOS and Android architecture to stay in sync.
  • Tooling for easier adoption on larger apps or teams. Tooling we are open sourcing includes IDE plugins for code generation and static code analysis.
  • Strong opinions about how state should be communicated, using DI and Rx. Each RIB defines its dependencies and what dependencies it needs from its parent. Parent components that fulfill a child’s parent dependencies are provided to child Builders as a constructor dependency to allow for hierarchical DI scoping. This means that information is communicated via these dependencies up and down the tree.

Usage

  1. Clone this repository
  2. Integrate using your preferred installation mechanism

For usage of the tooling built around RIBs, please see the Tooling section in our documentation.

Installation for 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.13.0'
  implementation 'com.uber.rib:rib-android:0.13.0'
  testImplementation 'com.uber.rib:rib-test:0.13.0'
}

There are a number of extension packages available as well including Kotlin extensions, Jetpack Compose support, Coroutines support

Installation for 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

Related projects

If you like RIBs, check out other related open source projects from our team:

  • Needle: a compile-time safe Swift dependency injection framework.
  • Motif: An abstract on top of Dagger offering simpler APIs for nested scopes.
  • Swift Concurrency: a set of concurrency utility classes used by Uber, inspired by the equivalent java.util.concurrent package classes.
  • Swift Abstract Class: a light-weight library along with an executable that enables compile-time safe abstract class development for Swift projects.
  • Swift Common: common libraries used by this set of Swift open source projects.

License

Copyright (C) 2017 Uber Technologies

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap