Preface

Reactive programming has been around for decades. There has been a few implementations of reactive programming from the time Smalltalk was a young language. However, it has only become popular recently and it is now becoming a trend. Why now you ask? Because it is good for writing fast, real-time applications and current technologies and the Web demand this.

I got involved in it back in 2008, when the team I was part of was developing a multimedia book creator called Sophie 2. It had to be fast and responsive so we created a framework called Prolib, which provided objects with properties which could depend on each other (in other words, we implemented bindings for Swing and much more—transformations, filtering, and so on). It felt natural to wire the model data to the GUI like this.

Of course, this was far away from the functional-like approach that comes with RX. In 2010, Microsoft released RX and, after that, Netflix ported it to Java—RxJava. However, Netflix released RxJava to the open source community and the project became a huge success. Many other languages have their port of RX and many alternatives to it. Now, you can code using reactive programming on your Java backend and wire it to your RxJava's frontend.

This book tries to explain to you what reactive programming is all about and how to use it with RxJava. It has many small examples and it explains concepts and API details in small steps. After reading this book, you will have an idea of RxJava, functional programming, and the reactive paradigm.

What this book covers

Chapter 1, An Introduction to Reactive Programming, will introduce you to the concept of reactive programming and will tell you why you should learn about it. This chapter contains examples that demonstrate how RxJava incorporates the reactive programming concept.

Chapter 2, Using the Functional Constructions of Java 8, will teach you how to use the new lambda constructions of Java 8. It will explain some functional programming concepts and will show you how to use them with RxJava in your reactive programs.

Chapter 3, Creating and Connecting Observables, Observers, and Subjects, will show you the basic building blocks of the RxJava library called the Observables. You will learn the difference between 'hot' and 'cold' Observables and how to subscribe to and unsubscribe from them using a subscription instance.

Chapter 4, Transforming, Filtering, and Accumulating Your Data, will walk you through the basic reactive operators, which you will learn how to use to achieve step-by-step computations. This chapter will give you an idea of how to transform the events the Observables emit, how to filter only the data we need, and how to group, accumulate, and process it.

Chapter 5, Combinators, Conditionals, and Error Handling, will present you with more complex reactive operators, which will allow you to master observable chaining. You will learn about the combining and conditional operators and how the Observables interact with each other. This chapter demonstrates the different approaches to error handling.

Chapter 6, Using Concurrency and Parallelism with Schedulers, will guide you through the process of writing concurrent and parallel programs with RxJava. This will be accomplished by the RxJava Schedulers. The types of Schedulers will be introduced and you will come to know when and why to use each one of them. This chapter will present you with a mechanism that will show you how to avoid and apply backpressure.

Chapter 7, Testing Your RxJava Application, will show you how to unit test your RxJava applications.

Chapter 8, Resource Management and Extending RxJava, will teach you how to manage the resources used as data sources by your RxJava applications. We will write our own Observable operators here.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.107.229