cancel
Showing results for 
Search instead for 
Did you mean: 

JSON V/s OData

Former Member
0 Kudos

Hi,

      What is the difference between using

var oModel = new sap.ui.model.json.JSONModel("http://services.odata.org/V3/(S(hwii2w0uoa1wgczn3bian230))/OData/OData.svc/Products");

and

var oModel = new sap.ui.model.odata.ODataModel("http://services.odata.org/V3/(S(hwii2w0uoa1wgczn3bian230))/OData/OData.svc/Products");

Which is recommended and why?

Accepted Solutions (1)

Accepted Solutions (1)

scott_stefanich
Active Participant
0 Kudos

In the SAP Documentation Developer Guide, the Models section helps describe and decide which models to use, along with links to their corresponding API Reference documentation.

As described in the documentation, the JSON, XML, and Resource models are client-side models intended for smaller complete sets of data with operations occurring on the client without additional server requests.

The OData model is a server-side model for partial sets of large data with operations occurring on the server with additional server requests.

For OData services such as your example and a variety of producers, an OData model is used for performing activities on the server such as sorting, filtering, and setting data.

Regards,

Scott

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Lahari,

If you are getting data from oData service it is recommended to use Odata Model as we have posting and retrievals.


-Moulika