RxJava Reactive Programming cover

RxJava Reactive Programming

No rating yet
Word count
299K words
Chapters
6
ISBN
9787121336409

Tags

Summary

RxJava's learning curve is not gentle: its concepts are abstract and there are many operators, so many beginners get stuck at the stage of "understanding a single example but failing to chain them together." The value of this book lies in smoothing the entry path: it first uses one chapter to clearly explain reactive programming and the relationship between Observable and Subscriber, then groups operators by the categories in the official diagrams, so readers can look them up as needed instead of memorizing them. Chapter 3 specifically discusses Scheduler selection, and Chapter 4 drills down one level to explain the source code, a part often skipped in similar introductory books. The cases in Chapter 5 are highly engineering-oriented: three-level image caching, Retrofit+OkHttp network requests, RxLifecycle for preventing memory leaks, and RxBinding for handling View events are all scenarios actually encountered in Android development and can be directly adapted into a project skeleton. Chapter 6 summarizes the changes from RxJava 1 to RxJava 2, making it easy for readers migrating from older versions to compare. The book has 228 pages and about 300,000 words, a restrained length that makes it suitable as the first RxJava book to keep on hand; note that the book focuses mainly on RxJava 1.x and introduces RxJava 2 as a supplement, so readers using newer versions in new projects still need to consult the official documentation for supplementary reading.

Editor's review

RxJava 的学习曲线不算平缓:概念抽象,操作符又多,许多初学者卡在“看得懂单个示例、串不成一条链”这一步。这本书的价值在于把入口铺平:先用一章讲清响应式编程与 Observable/Subscriber 的关系,再把操作符按官方示意图的类别归堆,读者可以按需求去查,而不是死记硬背。第 3 章专门讨论 Scheduler 的选择,第 4 章往下钻一层讲源码,这是不少同类入门书容易略过的部分。第 5 章的案例有很强的工程色彩:图片三级缓存、Retrofit+OkHttp 网络请求、RxLifecycle 防内存泄漏、RxBinding 处理 View 事件,基本都是 Android 开发中会真实遇到的场景,可以直接改造成项目骨架。第 6 章对 RxJava 1 到 RxJava 2 的变化做了归纳,方便从旧版本迁移的读者对照。全书 228 页、约 30 万字,体量克制,适合作为案头常备的第一本 RxJava 书;需要说明的是,书中内容以 RxJava 1.x 为主体、以 RxJava 2 为补充介绍,如今若在新项目中使用更高版本,仍需结合官方文档补充阅读。

Who it's for

A good fit for

  • 刚接触 RxJava、希望系统建立概念框架的 Android 开发者
  • 已经在项目里用 RxJava,但操作符与 Scheduler 用法常拿不准的工程师
  • 想理解 RxJava 内部实现原理、准备阅读源码的 Java 开发者
  • 需要为团队新人准备一份 RxJava 入门材料的资深工程师

Not a good fit for

  • 完全没有 Java 与 Android 基础、尚未写过异步代码的读者
  • 希望直接学习最新版 RxJava 与 Spring WebFlux 响应式栈的读者
  • 期望获得大量完整商业项目级架构讲解的架构师

Reading tips

  1. 先通读第 1 章与第 4 章,建立数据流与订阅关系的整体图景,再回头细读操作符。
  2. 第 2 章不必一次读完,可把它当作速查手册,遇到具体需求时按类别翻阅对应操作符。
  3. 阅读第 4、5 章时打开 IDE 跟着敲示例,改参数、加日志观察线程切换与数据流动。
  4. 读完第 6 章后对照官方文档整理一份 RxJava 1 与当前版本的差异清单,避免沿用旧写法。

About the publisher

Publishing House of Electronics Industry China · Founded in 1982

The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.

Contents

  1. Chapter 1 Entering the World of RxJava: 1.1 Reactive Programming; 1.2 What Is RxJava; 1.3 Observable and Subscriber; 1.4 Adding RxJava to an Android Project
  2. Chapter 2 Operators in RxJava: 2.1 Operators for Creating Observable; 2.2 Operators for Transforming Observable; 2.3 Filtering Operators; 2.4 Combination Operators; 2.5 Error Handling Operators; 2.6 Utility Operators; 2.7 Conditional Operations; 2.8 Aggregate Operators; 2.9 Operators Related to Connectable Observable; 2.10 Custom Operators
  3. Chapter 3 Thread Scheduling with Scheduler: 3.1 What Is Scheduler; 3.2 Types of Scheduler; 3.3 Summary
  4. Chapter 4 How RxJava Works: 4.1 Sending and Receiving Data; 4.2 Implementation of Operators; 4.3 Working Principles of Scheduler
  5. Chapter 5 Practical Examples of RxJava: 5.1 Calculating the Value of π; 5.2 Three-Level Image Caching; 5.3 Accessing the Network with Retrofit and OkHttp; 5.4 Using RxLifecycle to Avoid Memory Leaks; 5.5 Using RxBinding to Bind Various View Events
  6. Chapter 6 Improvements in RxJava 2: 6.1 Observable and Flowable; 6.2 Use of null; 6.3 Single and Completable; 6.4 Maybe; 6.5 Subscriber; 6.6 Action and Function; 6.7 Error Handling; 6.8 Scheduler

FAQ

这本书讲的是 RxJava 1 还是 RxJava 2?
主体内容以 RxJava 1 的概念与操作符为主,第 6 章专门介绍 RxJava 2 相对 RxJava 1 的改进,如 Observable 与 Flowable 的分工、null 的处理、Single/Completable/Maybe 等。若在 RxJava 2 及以上版本的项目中使用,建议同步查阅官方文档。
没有 Android 开发经验能读懂吗?
可以读懂概念与操作符部分,因为示例多为纯 Java 逻辑;但第 5 章涉及 RxLifecycle、RxBinding、图片三级缓存等内容,需要一定的 Android 基础才能完全吃透。
书中的示例代码多不多?
前言与官方介绍均强调配有丰富示例,第 2 章几乎每个操作符都配示意图和示例代码,第 5 章则给出完整度较高的应用案例,可直接参照动手实践。
这本书适合作为教学或培训教材吗?
篇幅约 228 页、六章结构清晰,章节可独立成讲座单元,适合作为内部培训的入门讲义;但书中不包含课后习题与系统性项目,作为正式课程教材还需自行补充练习。
和《RxJava 2.x 实战》有什么区别?
两书均由电子工业出版社出版,作者不同。《RxJava响应式编程》篇幅更短,偏入门与速查,并设有源码原理章节;《RxJava 2.x 实战》体量更大,直接以 RxJava 2 为主线,示例覆盖 Android 与 Java 后端。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

Top rated in the same category