Tuesday, 31 May 2016

Introduction to Reactive Programming

Introduction

In this post,  I'm going to discuss about Reactive Programming theoretical concepts and will develop some real-time  applications in my coming posts.

What is Reactive?

Reactive means "Non-blocking". Reactive Programming means writing code in a Non-Blocking way.
Non-Blocking means that make a call and continue doing with other work, don't wait for a response from that call. Do something once you get notification from that call.

Reactive programming is a paradigm to develop Non-Blocking Asynchronous Even-Based applications very easily.

Why we need Reactive Programming?

We need to use Reactive programming paradigm to get the following benefits:

  • We can develop highly Scalable and highly available applications very easily.
  • We can develop modular programming very easily so that we can get loosely coupling.
  • We can develop very responsive applications very easily.
  • We can develop Fault-Tolerant applications very easily.
  • We can develop Low Latency applications very easily.
  • We can develop Highly efficient and Better Performance applications very easily.
  • We can develop Asynchronous Non-Blocking code very easily.
  • We can develop Event-Driven or Message-Driven applications very easily.
  • We can develop more Flexible applications very easily.
  • We can develop more Robust applicatons very easily.

Reactive Programming Examples

In this section, we will discuss a list of clients who is using Reactive Programming, a list languages/Frameworks, which supports Reactive Programming.
  • RX Java - It supports Reactive Programming in JVM
  • Scala/Akka/Play Framework
  • React JS
  • Scalatra Framework
  • Micro Soft .NET C#
Clients who are using Reactive Programming Paradigm:
  • Netflix
  • Facebook
  • LinkedIn
  • Microsoft
  • Google
  • HSBC
  • Citigroup
  • UK DWP
and Many more clients.

The following are upcoming languages/Frameworks which supports Reactive Programming Paradigm:
  • Java 9
  • Spring 5 Framework
Java is going to add a reactive module in it's next version 9.
Spring Framework is going release a reactive module: spring-reactive soon in it's new version 5.

The principles of Reactive Programming

We can define Reactive Programming Paradigm by using the following four principles:
  • Responsive
  • Resilient (Fault-tolerant)
  • Message-Driven (Event-Driven)
  • Elastic (Scalable)

What is Functional Reactive Programming (FRP)?

Functional Reactive Programming (FRP) is a programming paradigm for Reactive Programming (RP) on Functional Programming (FP). That means a programming paradigm combining both FP and RP.

What is Object-Oriented Reactive Programming (OORP)?

Objecte-Oriented Reactive Programming (OORP) is a programming paradigm for Reactive Programming (RP) on Object-Oriented Programming (OOP). That means a combination of OOP and RP.

We will discuss some practical examples on Reactive Programming in my coming posts.

Please send me your valuable comments or suggestions or feedback about my posts.

Thank you for reading my tutorials.