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.
Pradeep Kumar replied
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 informationhttps://sapui5.netweaver.ondemand.com/sdk/#docs/guide/Introduction.1.html
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.