OData V4 - Intro

OData V4 - Intro

Brandeis Consulting & Cadao

Binding Modes in SAPUI5

  • One-way binding means a binding from the model to the view. Any value changes in the model update all corresponding bindings and the view.
  • Two-way binding means a binding from the model to the view and from the view to the model. Any changes in the model or the view fire events that automatically trigger updates of all corresponding bindings and both the view and the model.
_ One-way Two-way
OData V4 model default
OData V2 model default
JSON model default
XML model default

Detaillierte Erklärung der Binding Modes gibt es hier:
https://sapui5.hana.ondemand.com/sdk/#/topic/68b9644a253741e8a4b9e4279a35c247

Brandeis Consulting & Cadao

OData V4 - Lazy Loading und CRUD

Lazy Loading

  • OData V4 verfolgt den Lazy-Loading-Ansatz, sodass beim Start einer Anwendung anstelle des gesamten Datenmodells lediglich die notwendigen Ressourcen geladen werden.

CRUD

  • Auch die CRUD-Methoden des Models (create, read, remove, update) werden nicht länger unterstützt.
  • Stattdessen wird der Datenzugriff implizit über das Binding realisiert.

Beispiele

oContext = oSelectedItems[ i ].getBindingContext();
                    oContext.delete()

let oBindList = this.byId("idTable").getBinding("items");
oBindList.create({ });
Brandeis Consulting & Cadao

OData V4 - Abfrageoperationen

  • Unterstützung von Lambda Ausdrücken
  • Mit $expand können Nested Filter umgesetzt werden
/sap/opu/odata4/sap/ui_bank_manage/srvd/sap/ui_bank_manage/0001/Bank?$expand=_BankAddress&$filter=_BankAddress/BankCountry eq 'DE'
Brandeis Consulting & Cadao

OData V4 - Datentypen

Viele Datentypen aus OData V2 können weiterhin verwendet werden.

  • Binary, Boolean, String, ...

Verändert haben sich

  • DateTime -> DateTimeOffset, Time -> TimeOfDay
  • Neu: Date
  • Nicht unterstützt: Float
Brandeis Consulting & Cadao