This is the first of a series of blog articles on combining functional and RESTful paradigms.

RESTful programs are by definition resource oriented. Resource is an abstraction of a computational object. RESTful resources can represent a physical entity, an informational object and even an abstract entity. Resrouce oriented pardigm draws inspiration from the Web and hence with it carries the bias toward documents. For example it will be easy to make call like “Get /mylocation” in a RESTful setup than to make calls likeĀ  forecast weather at latitude 74.34564, longitude 34.0900 on 27th December 2016. There could be some RESTful ways of executing the above query but all of them are workarounds and do not adhere to the RESTful spirit.

As an improvement to RESTful services, I think network computation should be slit into two parts:

  1. Pure REST functionality where data is handled through RESTful services
  2. Functional APIs where computation on some parameters is done using functional programming paradigms.

This architecture allows for segregation of data mutations trough REST methods and immutable operations through function calls.

Follow

Leave a Reply

Your email address will not be published. Required fields are marked *