cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

oData Model/Json Model

Former Member
0 Likes
401

Hi Experts,

I have been working with both oData and Json Models. Now I want to know on technical grounds, that what factors lead to the selection of a model?

When to use which model?

Accepted Solutions (1)

Accepted Solutions (1)

kedarT
Active Contributor
0 Likes

Hi,

oData model is mostly used where situation demands for getting data from Backend system which make it a server side model, where as JSON model is for Client side model.

Also oData model is used for large dataset when compated to JSON Model which is for a small dataset which consume less memory.

More details can be found here:

SAPUI5 SDK - Demo Kit

Hope this helps you.

Answers (2)

Answers (2)

padma_mundru
Participant
0 Likes

Hi,




The ODataModel is a server-side model, so the whole dataset is only available on the server, the client only knows the currently visible rows and fields.

When you bind a control to an OData model , it comes with many features out of the box such and filtering capability, sorting, pagination etc. However the corresponding server side implementation needs to be in place. Using SAP Netweaver Gateway you can expose SAP ERP data in form of OData service and which can be easily consumed in UI5.

On the other hand JSON model is client side model based on JSON data to be used for small set of data.

JSON is just a Data-interchange format based on JavaScript.

I hope this may be helpful for you.

Former Member
0 Likes

Hi,

Thanks for your response.

Dibyakanta

SergioG_TX
SAP Champion
SAP Champion
0 Likes

oData Models are usually for larger sets of data, while JSON models are for smaller sets of data. It depends on what you will be using it for. For example, if you have a grid and you are binding a view from your SAP HANA db, you could easily use the oData model as you can do a direct bind. It would be a benefit to use oData because of the pagination, etc.

if you don't have a direct bind from the DB view into a control, then you could use a JSON model. for example, you could use a JSON model (as well as an OData Model) for a simple drop down box if you needed to alter some of the properties in the drop down items.

you however, could get data out of both models and you can get JSON objects. I hope this helps.