Skip to Content

Odata Model vs Jquery Ajax

There are various ways by which we can call an Odata webservice in our fiori/ui5 application  for eg. using Odata model or by using Jquery Ajax.

Which of the method is preferred in different circumstances and what are the advantages/disadvantages which needs to be considered while deciding the approach.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 23, 2015 at 10:05 AM


    The UI5 models use jQuery.ajax themselves which you can see if you delve into the .js files (e.g. resources\sap\ui\model\json\JSONModel.js).

    The main advantage to using a model is that it holds your data and you can bind your UI5 controls to it - suggest you check out this link for more information

    There may be certain situations where you would want to use your own jQuery.ajax call, for example posting data from your application to a web service.

    all Model which is introduced in sapui5 internally use same concept as jQuery Ajax.

    1. jQuery Ajax is a hard coded process. Via this checking return data type, Accordingly Parsing and Binding of data is your responsibility.

    2. Using Model is beast practice when you know your services return data  type,According that you can bind directly and use it.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 23, 2015 at 10:07 AM

    Hi Amber,

    ODATA Model is preferable.

    1. OData protocol is that it is becoming an OASIS standard

    2. Next version of the OData protocol (v4) it is planned to support delta queries as part of the standard

    3. Use OData models instead of normal Ajax calls. Odata Models are tightly integrated to the UI5 controls also. When the data changes, all the controls will be updated automatically.


    Karthik A

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 25, 2015 at 01:47 AM

    HI Amber

    sap.ui.model.odata.ODataModel shall be the model to use when your UI needs to interact with oData service. It is very difficult to "talk" to the oData service with jQuery.ajax. The sap.ui.model.odata.ODataModel provides you with the necessary functions.

    If the service is not oData based, then we have to discuss more.



    Add comment
    10|10000 characters needed characters exceeded