A few days ago I wrote a blog about deprecated SAP GW APIs here in the SAP Gateway Community. If you use the ODataModel in UI5 you have multiple options:

Feel free to choose which one you want to use – NOT!

Don’t use sap.ui.model.odata.ODataModel¬†because it’s deprecated! Yes, that’s correct! That’s why it’s not used in in any of the tutorials! And this information is not new. In fact, it’s deprecated since summer 2015 if I remember right. However, this is not clearly mentioned in the API docs:

From the API docs (see screenshot and/or links above) you would not guess it’s deprecated. However, have a look at SAPUI5 1.30.6 – Instantiating an OData Model and SAPUI5 1.42.8 –¬†OData V2 Model of the Developer Guide:

“The v2.ODataModel has an improved feature set and new features will only be implemented in this model. sap.ui.model.odata.ODataModel is deprecated. We recommend to only use v2.ODataModel.”

Especially for new apps make sure you use the v2.ODataModel or (if you can) the v4.ODataModel. When I make code reviews I typically reject code/apps using the old ODataModel. In the view of some developers this might look a little harsh… Hmm, what do you think?

Best,
Nabi

UPDATE: The correct year is 2015 and not 2014

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Michael Graf

    Thanks for pointing this out, indeed one should avoid using deprecated APIs, especially in the model as it does not contain various improvements we did in OData model V2.
    In the near future, we will also have an application check that can be executed on app level and make this more visible.

    (3) 

Leave a Reply