{"id":352,"date":"2014-10-22T08:15:54","date_gmt":"2014-10-22T02:45:54","guid":{"rendered":"http:\/\/www.cyberaka.com\/?p=352"},"modified":"2014-10-22T08:16:31","modified_gmt":"2014-10-22T02:46:31","slug":"reactive-programming","status":"publish","type":"post","link":"https:\/\/www.cyberaka.com\/?p=352","title":{"rendered":"Reactive programming"},"content":{"rendered":"<p>Reactive Programming seems to be the rage nowadays (as observed in blogs and newsletter). Out of curiosity I looked it up and was impressed with what it is capable of. Turns out that this is a declarative approach which allow code to react to changes in referenced values.<\/p>\n<p>Let&#8217;s understand it from the perspective of a spread sheet. Lets say cell A1 has the formula &#8220;=B1+C1&#8221;. Now typically we expect that if we change the value in B1 or C1 then the value of cell A1 will be updated automatically.<\/p>\n<p>Keeping this example in mind now lets see how\u00a0 this can work in programming world. Lets say we have an expression that says A = B + C. When this expression is executed in our code then the value of A is updated whenever this expression is &#8216;executed&#8217;. Once this is done the value of B can be changed or the value of C can be changed without reflecting on the value of A. To enforce a ripple effect back to A like we observed for cell A1 in spreadsheet we have to devise elaborate observers \/ listeners on the values of B and C to update A whenever the value of B or C change. In a real life production environment this simple expression can be replaced with more complex algorithm or data flow and you have a situation which can quickly get out of hand and might be difficult if not impossible to debug.<\/p>\n<p>In reactive programming we react to changes. So in the above situation the value of variable A will be updated as and when the value of B or C changes.<\/p>\n<p>This concept has been well explained in a <a title=\"Reactive Programming\" href=\"http:\/\/java.dzone.com\/articles\/reactive-programming-database\">dzone article<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reactive Programming seems to be the rage nowadays (as observed in blogs and newsletter). Out of curiosity I looked it up and was impressed with what it is capable of. Turns out that this is a declarative approach which allow code to react to changes in referenced values. Let&#8217;s understand it from the perspective of [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-352","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=352"}],"version-history":[{"count":1,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/352\/revisions"}],"predecessor-version":[{"id":353,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=\/wp\/v2\/posts\/352\/revisions\/353"}],"wp:attachment":[{"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cyberaka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}