Giter Site home page Giter Site logo

bro's Introduction

Bro

English | δΈ­ζ–‡

JCenter Apache 2

A Modularization Solution on Android platform.

Why Modularization

  • The processes that you navigate among Native Activity, H5, RN, Weex are complicated and don't have a consistent logic. (For example, some pages required login session while others not.)
  • You want to display different UIs and functionalities to different user groups, but you have to add plenty of if/else blocks in all relevant areas.
  • The module you are maintaining on is required to expose some APIs for other modules. However, no one wants to be dependent on each other directly and there is not a global universal communication channel that you can use (In that case, you may already got a lot of BroadcastReceivers or EventBuses everywhere)
  • Although you work in a small team (probably less than ten people), team members still want to develop their modules as independently as possible, even build and debug one module independently without being influenced by others. (You may need to mock any other depended APIs)
  • ...

All of these problems are what I have met and what Bro tries to solve. We suggest reading <From.Containerization.To.Modularity> before continue integrating Bro (shared by Oasis Feng at the end of 2016), you will get a clear target of what problems are modularization and componentization trying to solve.

(Quoted From the Slide)

  • Engineering

    • Enforced decoupling for high-cohesion code.
    • Module-independent(parallel) development and testing
    • Flexible integration, deployment&upgrade
  • Product

    • Selective Installation(light-weight initial install)
    • Hybrid-friendly(web&native, mix&match)
    • Open to (3rd-party) extensions

It's vital to emphasize this concept that Bro's goal is not to be a routing framework, but a lightweight modular infrastructure aimed at component decoupling and efficient development.

Features

  • Supports individual initialization for each module and be convenient to monitor the initialization cost;
  • Supports Activity routing, and supports customizing global consistent URI rules for Native Activity and Web, ReactNative, Weex and other containers;
  • Supports the interface exposure and interfaces acquisition among modules, and even to implement the acquisition Fragment or start Service from other modules.
  • Supports customizing annotations (used by adding identification), sub-annotation-processor (used by generating custom routing table or docs), properties of Activities, Services, etc. (used by Interceptor).
  • Supports global interceptors and monitors to intercept all the processes above-mentioned and acquires the custom properties of Activities and Services in interceptors conveniently.
  • Supports automatically generating the page routing table (Java Class) and documentation including all custom properties.
  • For more customization please refer to the best practices section of the subsequent documentation.

Tutorial

All docs are hosting on Github Page using Docsify. Contributing to /docs directory is welcome.

Compatible Specification

Bro is only supported & tested on latest 2 Minor versions of Android Gradle Plugin.

AGP Version Latest Support Version
3.6.x JCenter
3.5.x 1.3.4
3.4.x 1.1.0

Git Commit Check

Check this link to make sure everyone will make a meaningful commit message.

So far we haven't added any hook tool, but follow the regex below:

(chore|feat|docs|fix|refactor|style|test|hack|release)(:)( )(.{0,80})

License

Copyright 2016-2020 2BAB

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.

bro's People

Contributors

2bab avatar kolibreath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bro's Issues

Separate /bro to 3 libs

  1. Target
  • /bro with package name me.xx2bab.bro.core
  • /bro-nav with package name me.xx2bab.bro.nav
  • /bro-service-locator with package name me.xx2bab.bro.service-locator
  1. Spec
  • /bro will call 2 child libs by reflection, when is not applied, returns null on specific API calling
  • In addition, when the service-locator is not applied, the dependencies detecting feature of the lib should consider again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.