Continuing on the previous posts, RESTful paradigm treats everything as a resource (data and functions both). Any methods applied on a REST server will modify the state and subsequent methods can yield different results. This is not compatible with functional style. If resources are classified as data and functions, then one can implement mutable data and functional calls without any side effects.

Parameters can be passed as part of request or as data objects with URIs. This integrates functional programming with RESTful architecture to some extent. There are two key innovations here:

  1. Segregation of resources as data and functions. This segregation helps in identifying which calls will have side effects and which will not.
  2. Parameter passing through http. This helps in simplifying certain calls where a computation needs to be done on some variables.

Functional resources might remind one of RPC but they are fundamentally different as we need not maintain session between the client and the server and all the intercation can happen over HTTP. This architecture is ideal where data and computation both are equally important.

Follow

Leave a Reply

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