Search code examples
restdistributed-computing

Can Restful web service contain functions


I am new to web-services. As I understood restful services is a method to achieve distributed computing. I know RMI is also a method to achieve that along with many other technologies such as SOAP. Now my question is, I see so much admiration about restful web service in the internet. But as I know Restful only can contains states of objects. It can't contain functions. Is not it? Have I got it wrong? How could it be so strong then to achieve distributed computing. Why everyone say it is so better that RMI or SOAP then?


Solution

  • You are right. It doesn't contain function. Only holds the data.

    The reason people say about RMI/SOAP about the function/operation are easy to manage just because you don't have to worry about the function/operation to execute. RMI is designed to invoke function in remote machine. And SOAP message having explicit operation and data which determine the function. Though RMI and SOAP are different.

    But you can easily achieve this kind of functionality by using REST. You are having only data for REST. And data can represent function/operation identity including the data for function/operation. You just need to think about it. Though the tool/library for REST is vast to develop/maintain distributed services.