An effort to bring a revolution in Salesforce.

Tuesday 26 July 2016

difference between a normal wrapper and a REST API wrapper



Please find the difference between a normal wrapper and a REST API wrapper.


Wrapper Class : A Wrapper Class (or the Wrapper Pattern) is where you declare a Class as a container for an sObject to extend the functionality only for display or processing purposes (i.e. you don't intend for that attribute to be persisted) - the classic example is a checkbox to select records. I would say that a DTO is a slightly dumbed down version of such a wrapper (used in conventional OOP to pass structured data between the layers)

REST API Wrapper : A REST API wrapper is something slightly different. Salesforce exposes a REST API and if you were to invoke that say from C#, you would have to perform a set of common steps such as login, query, etc. To make this available in C# by abstracting the innards of the actual REST calls to salesforce and exposing only the developer relevant detail, you could write a rest wrapper which performs these commonly used functions - creates requests, parses responses, etc.

For use cases please refer to the below link.
https://www.godaddy.com/garage/webpro/wordpress/3-practical-use-cases-wp-rest-api/
, , ,

No comments:

Post a Comment

Get Gmail, Docs, Drive, and Calendar for business