Java Magazine, Jan/Feb 2018
Reactive Programming with JAX RS Using an async approach and staging to develop responsive reactive apps ORACLE COM JAVAMAGAZINE JANUARY FEBRUARY 2018 16 reactive programming Reactive programming sounds like the name of an emerging programming paradigm at first but it refers to a programming technique that ofers an event driven approach for handling asynchronous streams of data Based on data that flows continuously reactive systems react to the data by executing a series of events Reactive programming follows the Observer design pattern which can be defined as follows when there is a change of state in one object the other objects are notified and updated accordingly Therefore instead of polling events for the changes events are pushed asynchronously so the observers can process them In this example observers are functions that are executed when an event is emitted And the data stream that I mentioned is the actual observable that will be observed Nearly all languages and frameworks have adopted this programming approach in their ecosystems and Java has kept the pace up in its latest releases In this article I explain how reactive programming can be applied by using the latest version of JAX RS from Java EE 8 and by using Java 8 features under the hood The Reactive Manifesto The Reactive Manifesto lists four fundamental aspects an application must have in order to be more flexible loosely coupled and easily scalable and therefore capable of being reactive It says an application should be responsive elastic that is scalable resilient and message driven Having an application that is truly responsive is the foundational goal Suppose you have an application that heavily depends on one big thread to handle user requests and this thread MERT ÇALIS KAN
You must have JavaScript enabled to view digital editions.