cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between JSON model and ODATA model in UI5?

Former Member
0 Kudos

In SAP UI5 , the data comes from the backend is usually oData and the new custom model created in the application is json model. Now can also oData model be created in the application & what's the difference between oData model and json model ?

Accepted Solutions (1)

Accepted Solutions (1)

former_member184867
Active Contributor
0 Kudos

OData model is a model based on a OData Service which a REST based model. OData allows you to perform SQL Query like operation on the URL(and it is like ODBC for Web!!). You can read more about OData service in Home | Open Data Protocol | ODataOpen Data Protocol | OData

As per UI5 Documentation

The ODataModel is a server-side model, so the whole dataset is only available on the server, the client only nows 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.

Regards,

Atanu



Former Member
0 Kudos

Can we create a new oData model as client side model using javascript ?

former_member184867
Active Contributor

The OData model is a server side model and is exposed via a URL.  For example : http://services.odata.org/Northwind/Northwind.svc/.

In UI5 you can define a OData Model object using the OData service URL. The UI5 OData Model object will be responsible for calling various URLs to access different resources exposed by the OData service.  May be you can have  a look at to get more information.

Answers (0)