前言
公司用到rxjava,學習Learning-Rxjava筆記
本書源碼位置:https://github.com/PacktPubli...java
做爲程序員,咱們的工做是Modeling our world with code,object-oriented programming 很好地抽象咱們的世界,可是,As 2010 approached, it became clear that object-oriented programming only solved part of the problem.react
Classes and objects do a great job of representing an entity with properties and methods,可是各個entity 之間的複雜關係的抽象,使得面向對象編程有不少模板化的代碼,十分臃腫,此時,functional programming捲土重來,做爲object-oriented的一個補充。Reactive
programming, a functional event-driven programming approach, began to receive special attention.微軟的Erik Meijer 爲.net寫了一個 Reactive Extensions的框架,後來其1.0Rx和2.0ReactiveX逐漸擴展到其它語言。git
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.github
對象都是運動和變化的
好比天氣。書本上的內容是靜止不變的,可是,當讀者看書時,書上的內容被讀者的眼睛一點點消費,那麼其內容也是變化的。也是
對象都是相互關聯的
好比天氣和人的行爲。
對象的變化都是在同時(並行)的
好比馬路上,機動車道上的汽車和非機動車道路上的人都是同時運行的。彼此還要相互觀察。編程
因此能夠使用 multiple concurrent streams of events or data happening at the same time 來modeling worldapp