RxJava overview, RxJava

Source: Internet
Author: User

RxJava overview, RxJava

RxJava explanation for Android Developers: http://gank.io/post/560e15be2dca930e00da1083

 

Responsive programming is a programming paradigm of asynchronous data stream interaction. RxJava is a library implemented on Java based on event-based asynchronous data stream.
The core idea is to treat everything as data streams, various variables, user input, data structure, cache, etc.
The Rx Library provides highly abstract functions for stream operations, such as creation, inbound and outbound, filtering, merging, and ing.
In addition, the Rx Library also simplifies asynchronous operations and error handling.


The obvious advantage after RxJava is used is
1 solved the problem of callback hell (that is, many layers of callback nesting ).
2. Convenient thread Switching
3. With the new feature of Java 8, mongolambda, the code will be further concise
The deeper advantage is to deepen the code abstraction so that we can focus more on the business logic rather than the specific implementation details.
In addition, the event-driven system can be decoupled into multiple components, enabling better code scalability and fault tolerance.


But there are also some difficulties
1. to make good use of responsive programming, We must train stream-based programming thinking, which is quite different from the past.
This will make it difficult to refactor the code in the past, and often write "semi-finished products" because the thinking is not pure"
2 because the operators in the Rx library are highly abstract, it is very convenient to use, but the cost of in-depth understanding is very high.
3 because the Rx library is very abstract and young, there will be many pitfalls to be aware of during use, and Lambda will bring some performance impact.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.