java-LearningRxjava-ch01-Thinking Reactively

3次阅读

共计 1032 个字符,预计需要花费 3 分钟才能阅读完成。

前言公司用到 rxjava,学习 Learning-Rxjava 笔记本书源码位置:https://github.com/PacktPubli…
1.A brief history of ReactiveX and RxJava
作为程序员,我们的工作是 Modeling our world with code,object-oriented programming 很好地抽象我们的世界,但是,As 2010 approached, it became clear that object-oriented programming only solved part of the problem.
Classes and objects do a great job of representing an entity with properties and methods, 但是各个 entity 之间的复杂关系的抽象,使得面向对象编程有很多模板化的代码,十分臃肿,此时,functional programming 卷土重来,作为 object-oriented 的一个补充。Reactiveprogramming, a functional event-driven programming approach, began to receive special attention. 微软的 Erik Meijer 为.net 写了一个 Reactive Extensions 的框架,后来其 1.0Rx 和 2.0ReactiveX 逐渐扩展到其它语言。
Netflix 公司的 Ben Christensen 和 David Karnok 作为主要人员创作了 rx-java. 其中 RxJava 1.0 在 2014 年 11 月发布 , RxJava 2.0 在 2016 年 11 月发布。
reactiveX 的核心理念是:The fundamental idea of ReactiveX is that events are data and data are events.
2.Thinking reactively
对象都是运动和变化的比如天气。书本上的内容是静止不变的,但是,当读者看书时,书上的内容被读者的眼睛一点点消费,那么其内容也是变化的。也是对象都是相互关联的比如天气和人的行为。对象的变化都是在同时(并行)的比如马路上,机动车道上的汽车和非机动车道路上的人都是同时运行的。彼此还要相互观察。
所以可以使用 multiple concurrent streams of events or data happening at the same time 来 modeling world

正文完
 0