SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Patric Ksinsik & Thomas Chadzelek, SAP SE
June 30, 2017
UI5 OData V4 Model
Some theory:
What is OData?
OData V2 vs. OData V4
3
OData…
 is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming
RESTful APIs
 helps you focus on your business logic while building RESTful APIs without having to worry about the
various approaches to define request and response headers, status codes, HTTP methods, URL
conventions, media types, payload formats, query options, etc.
 provides metadata, a machine-readable description of the data model of the APIs, enables the creation of
powerful generic client proxies and tools
What is OData? (from odata.org)
4
Performance
 New JSON Format (data): ~ 10% to 60% payload size reduction for lists after compression
– No inline metadata (__metadata)
– Messages part of payload (compressible) – V2 only header (not compressible)
 Cross-Service Navigation: Lazy loading of huge service models
Features
 Improved type system: New data types (esp. in date/time area, e.g. Duration), inheritance, collection values
 $filter with lambda operators ”any” and “all” for conditions on navigation properties
People?$filter=Emails/any(a:endswith(a,'@example.com'))
 $expand with query options
People?$expand=Friends($filter=Emails/any(a:endswith(a,'@example.com')))
 … and many more
Why OData V4? Pro’s vs. OData V2 (Excerpt)
Practice:
OData V4 model features by example
6
Based on public OData V4 service http://services.odata.org/TripPinRESTierService
 Do try this at home 
Sample application
7
Initialize model as dataSource in manifest.json, mandatory settings
 serviceUrl is the root URL of the service, e.g. “/odata_org/TripPinRESTierService/”
 synchronizationMode (reserved for future enhancements); must be “None”
Design principle: Data access via bindings
 Binding path is OData resource path, e.g. “/People”
 Binding parameters are
– query options for request (e.g. $expand, $filter, …)
– exception: $$-parameters  binding specific parameter to control binding behavior (e.g. $$groupId)
(1) Model Instantiation and Data Access
8
 Create app skeleton with manifest.json: Define dataSource for TripPin service , see also TripPin data model
 Main.view.xml displays table on /People (First Name, Last Name, Age)
 Show automatic paging ($top, $skip) for list binding
Demo - (1) Model Instantiation and Data Access
9
Auto-type detection
 Derive UI5 type from $metadata
Formatting, parsing, validation between model value and UI value
 Override by specifying type in binding information
Binding mode: TwoWay is default  Changes to model written to service backend
(2) Auto-type detection, data update
10
 Validate with auto-detected types: Switch on validation in manifest.json (handleValidation)
 Modify value in First Name (not nullable), Age (Int64): Show validation incl. language dependent error
message
 Show $batch with PATCH in network which sends update to the backend
Demo - (2) Auto-type detection, data update
11
Batch groups
 Determine bundling of data service requests in a $batch POST request
 “$auto”: requests are queued until just before rendering and then sent in one $batch (default)
 “$direct”: requests are sent directly, no $batch
 Name without $ prefix: "Deferred group", request triggered via submitBatch on model
 Can be set for
 Model: groupId, updateGroupId model settings
 Binding: parameter $$groupId, $$updateGroupId
Related APIs
 resetChanges resets pending changes for a batch group or binding
 hasPendingChanges checks for pending changes for complete model or one binding
(3) Batch groups
12
 Set model groupId to $direct (easier to look at read requests in browser dev tools)
– Demo: Change from POST/$batch to direct GET in dev tools
 Set model updateGroupId to “updatePeople”
 “Save” button
– triggers submitBatch(“updatePeople”)
– sets view to busy until submitBatch returns to avoid input while request is being sent
 Demo: no $batch on leaving input field, but only on save button
 “Reset changes” button triggers resetChanges
Demo - (3) Batch groups
13
 Prerequisite for filter and sort: Model setting operationMode set to “Server”
 Specify filter and sorter via
 ODataListBinding APIs filter and sort which take a sap.ui.model.Filter/Sorter object
 $filter, $orderby binding parameters. Changed with changeParameters API on binding.
Useful if OData filter options not covered by UI5 Filter or if sort or filter values never change.
 Filters can specify lambda operators ”any” and “all” for conditions on navigation properties
 Set $count=true at ODataListBinding to retrieve inline count.
Bind it in table header; note: use headerContext!
(4) Filtering and sorting, bind $count
14
 Sort on “Last name” column via button in column header; iterate sort order "", "asc", "desc“
 Filter on “Last name”: Use changeParameters for infix search
$filter = contains(tolower(LastName),‘<input’)
 Demo: resulting requests in dev tools
Demo - (4) Filtering and sorting
15
 OData V4 model computes $expand and $select for OData requests from UI
 Benefits
 Performance: Only load data required for UI
 Convenience: No need to specify $expand manually as binding parameter
 Switch on with model setting autoExpandSelect : true
 Auto-$select of key properties: required for write requests on entity
 Hard-coded $select and $expand binding parameters are merged
 Feature released with OpenUI5 1.48
(5) Auto-$expand/$select
16
Without auto-$expand/$select
…/People Uncompressed size: 8.5 kB
(5) Auto-$expand/$select: response size comparison
With auto-$expand/$select
…/People?$select=Age,FirstName,LastName,UserN
ame Uncompressed size: 2.0 kB
17
Support actions (side effects on server) and functions (no side effects) via "operation binding“
 ODataContextBinding with path “<operation name>()”
 Deferred operation with ellipsis “<operation name>(...)”  execution triggered via API
 Actions must be deferred as they have side-effects
 Bound operation’s “binding parameter” defined by context of relative operation binding
APIs
 setParameter
 execute for deferred operation
 refresh
(6) OData operations and refresh
18
 Button "Reset Data" calls action import via operation binding with path “/ResetDataSource(...)”
– execute success: show success message and refresh the model to see the data reset
– execute failure: show error message
 Button “Refresh” calls refresh on model
Demo - (6) OData operations and refresh
19
Create
 Call create on ODataListBinding with given initial data
Returns a context referring to the created entity
 The resulting entity is "transient" until deleted or saved to the backend
 The created method on the context provides a promise which is resolved when the entity is
saved
 Limitation: You have to call refresh before calling create again
Delete
 Delete an entity via delete on a context
Returns a promise which allows for success and error handling.
(7) Create and Delete
20
 "Create" button calls the create API with hardcoded initial data; once the returned created promise is
fulfilled, show a success message
 Demo
– “Save” button sends the POST
– “Reset changes” button deletes the transient “People” instance
– After “Save” and “Refresh”, a new entity can be created
 “Delete” button calls delete for the context of the currently selected Person
Demo - (7) Create and Delete
Slides incl. sources
https://www.slideshare.net/PatricKsinsik/ui5con-presentation-on-ui5-odata-
v4-model
Questions or feedback?
Discuss with us in our „Meet the Expert”
slot from 14 – 14:40
Thank you.
Contact information:
Patric Ksinsik, p.ksinsik@sap.com
Thomas Chadzelek, thomas.chadzelek@sap.com
You are welcome to give feedback for this session
in the UI5con Event App

Weitere ähnliche Inhalte

Was ist angesagt?

OOD Principles and Patterns
OOD Principles and PatternsOOD Principles and Patterns
OOD Principles and PatternsNguyen Tung
 
Hacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source codeHacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source codeZhongyue Luo
 
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...Serge Huber
 
Apache Arrow: High Performance Columnar Data Framework
Apache Arrow: High Performance Columnar Data FrameworkApache Arrow: High Performance Columnar Data Framework
Apache Arrow: High Performance Columnar Data FrameworkWes McKinney
 
Spring cloud on kubernetes
Spring cloud on kubernetesSpring cloud on kubernetes
Spring cloud on kubernetesSangSun Park
 
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Databricks
 
U2 Replication with EDA for Report Servers
U2 Replication with EDA for Report ServersU2 Replication with EDA for Report Servers
U2 Replication with EDA for Report ServersRocket Software
 
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack CascadingBuilding Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack CascadingJoe Huang
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetMichael Lessard
 
Ozone and HDFS’s evolution
Ozone and HDFS’s evolutionOzone and HDFS’s evolution
Ozone and HDFS’s evolutionDataWorks Summit
 
Apache Spark Streaming in K8s with ArgoCD & Spark Operator
Apache Spark Streaming in K8s with ArgoCD & Spark OperatorApache Spark Streaming in K8s with ArgoCD & Spark Operator
Apache Spark Streaming in K8s with ArgoCD & Spark OperatorDatabricks
 
Hoodie: Incremental processing on hadoop
Hoodie: Incremental processing on hadoopHoodie: Incremental processing on hadoop
Hoodie: Incremental processing on hadoopPrasanna Rajaperumal
 
Fire in the Sky: An Introduction to Monitoring Apache Spark in the Cloud with...
Fire in the Sky: An Introduction to Monitoring Apache Spark in the Cloud with...Fire in the Sky: An Introduction to Monitoring Apache Spark in the Cloud with...
Fire in the Sky: An Introduction to Monitoring Apache Spark in the Cloud with...Spark Summit
 
End-to-end Data Pipeline with Apache Spark
End-to-end Data Pipeline with Apache SparkEnd-to-end Data Pipeline with Apache Spark
End-to-end Data Pipeline with Apache SparkDatabricks
 
MongoDB World 2019: MongoDB Atlas Security 101 for Developers
MongoDB World 2019: MongoDB Atlas Security 101 for DevelopersMongoDB World 2019: MongoDB Atlas Security 101 for Developers
MongoDB World 2019: MongoDB Atlas Security 101 for DevelopersMongoDB
 
DSpace for Cultural Heritage: adding support for images visualization,audio/v...
DSpace for Cultural Heritage: adding support for images visualization,audio/v...DSpace for Cultural Heritage: adding support for images visualization,audio/v...
DSpace for Cultural Heritage: adding support for images visualization,audio/v...4Science
 
Microsoft Project Server Basics
Microsoft Project Server BasicsMicrosoft Project Server Basics
Microsoft Project Server BasicsMandar Risbud
 
Exchange and Consumption of Huge RDF Data
Exchange and Consumption of Huge RDF DataExchange and Consumption of Huge RDF Data
Exchange and Consumption of Huge RDF DataMario Arias
 

Was ist angesagt? (20)

OOD Principles and Patterns
OOD Principles and PatternsOOD Principles and Patterns
OOD Principles and Patterns
 
Hacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source codeHacking on OpenStack\'s Nova source code
Hacking on OpenStack\'s Nova source code
 
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
ApacheCon NA 2019 : Adding AI to customer segmentation using Apache Unomi and...
 
Apache Arrow: High Performance Columnar Data Framework
Apache Arrow: High Performance Columnar Data FrameworkApache Arrow: High Performance Columnar Data Framework
Apache Arrow: High Performance Columnar Data Framework
 
Spring cloud on kubernetes
Spring cloud on kubernetesSpring cloud on kubernetes
Spring cloud on kubernetes
 
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...Building a Streaming Microservice Architecture: with Apache Spark Structured ...
Building a Streaming Microservice Architecture: with Apache Spark Structured ...
 
U2 Replication with EDA for Report Servers
U2 Replication with EDA for Report ServersU2 Replication with EDA for Report Servers
U2 Replication with EDA for Report Servers
 
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack CascadingBuilding Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
Building Multi-Site and Multi-OpenStack Cloud with OpenStack Cascading
 
Integrating Apache Spark and NiFi for Data Lakes
Integrating Apache Spark and NiFi for Data LakesIntegrating Apache Spark and NiFi for Data Lakes
Integrating Apache Spark and NiFi for Data Lakes
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
 
Ozone and HDFS’s evolution
Ozone and HDFS’s evolutionOzone and HDFS’s evolution
Ozone and HDFS’s evolution
 
Apache Spark Streaming in K8s with ArgoCD & Spark Operator
Apache Spark Streaming in K8s with ArgoCD & Spark OperatorApache Spark Streaming in K8s with ArgoCD & Spark Operator
Apache Spark Streaming in K8s with ArgoCD & Spark Operator
 
Hoodie: Incremental processing on hadoop
Hoodie: Incremental processing on hadoopHoodie: Incremental processing on hadoop
Hoodie: Incremental processing on hadoop
 
Fire in the Sky: An Introduction to Monitoring Apache Spark in the Cloud with...
Fire in the Sky: An Introduction to Monitoring Apache Spark in the Cloud with...Fire in the Sky: An Introduction to Monitoring Apache Spark in the Cloud with...
Fire in the Sky: An Introduction to Monitoring Apache Spark in the Cloud with...
 
End-to-end Data Pipeline with Apache Spark
End-to-end Data Pipeline with Apache SparkEnd-to-end Data Pipeline with Apache Spark
End-to-end Data Pipeline with Apache Spark
 
MongoDB World 2019: MongoDB Atlas Security 101 for Developers
MongoDB World 2019: MongoDB Atlas Security 101 for DevelopersMongoDB World 2019: MongoDB Atlas Security 101 for Developers
MongoDB World 2019: MongoDB Atlas Security 101 for Developers
 
Zuul @ Netflix SpringOne Platform
Zuul @ Netflix SpringOne PlatformZuul @ Netflix SpringOne Platform
Zuul @ Netflix SpringOne Platform
 
DSpace for Cultural Heritage: adding support for images visualization,audio/v...
DSpace for Cultural Heritage: adding support for images visualization,audio/v...DSpace for Cultural Heritage: adding support for images visualization,audio/v...
DSpace for Cultural Heritage: adding support for images visualization,audio/v...
 
Microsoft Project Server Basics
Microsoft Project Server BasicsMicrosoft Project Server Basics
Microsoft Project Server Basics
 
Exchange and Consumption of Huge RDF Data
Exchange and Consumption of Huge RDF DataExchange and Consumption of Huge RDF Data
Exchange and Consumption of Huge RDF Data
 

Ähnlich wie UI5 OData V4 Model Features

Wcf data services
Wcf data servicesWcf data services
Wcf data servicesEyal Vardi
 
MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataPace Integration
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesAshish Saxena
 
ADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoHasnain Iqbal
 
ADO.NET Data Services
ADO.NET Data ServicesADO.NET Data Services
ADO.NET Data Servicesukdpe
 
Designing REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDesigning REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDmitriy Sobko
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Igor Moochnick
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIGert Drapers
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsRapidValue
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocolWoodruff Solutions LLC
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Eric D. Boyd
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...SharePoint Saturday NY
 
How to disassemble one monster app into an ecosystem of 30
How to disassemble one monster app into an ecosystem of 30How to disassemble one monster app into an ecosystem of 30
How to disassemble one monster app into an ecosystem of 30fiyuer
 
JAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and RetrievalJAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and RetrievalDr. Ranbijay Kumar
 
Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)David McCarter
 

Ähnlich wie UI5 OData V4 Model Features (20)

Wcf data services
Wcf data servicesWcf data services
Wcf data services
 
MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and OData
 
SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & Guidelines
 
ADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael PizzoADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
ADO.NET Entity Framework by Jose A. Blakeley and Michael Pizzo
 
Ch 7 data binding
Ch 7 data bindingCh 7 data binding
Ch 7 data binding
 
ADO.NET Data Services
ADO.NET Data ServicesADO.NET Data Services
ADO.NET Data Services
 
Practical OData
Practical ODataPractical OData
Practical OData
 
Designing REST API automation tests in Kotlin
Designing REST API automation tests in KotlinDesigning REST API automation tests in Kotlin
Designing REST API automation tests in Kotlin
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
 
Olap
OlapOlap
Olap
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPI
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
 
Breaking down data silos with the open data protocol
Breaking down data silos with the open data protocolBreaking down data silos with the open data protocol
Breaking down data silos with the open data protocol
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
 
How to disassemble one monster app into an ecosystem of 30
How to disassemble one monster app into an ecosystem of 30How to disassemble one monster app into an ecosystem of 30
How to disassemble one monster app into an ecosystem of 30
 
JAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and RetrievalJAM819 - Native API Deep Dive: Data Storage and Retrieval
JAM819 - Native API Deep Dive: Data Storage and Retrieval
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Data Product Architectures
Data Product ArchitecturesData Product Architectures
Data Product Architectures
 
Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)
 

Kürzlich hochgeladen

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Kürzlich hochgeladen (20)

DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

UI5 OData V4 Model Features

  • 1. Patric Ksinsik & Thomas Chadzelek, SAP SE June 30, 2017 UI5 OData V4 Model
  • 2. Some theory: What is OData? OData V2 vs. OData V4
  • 3. 3 OData…  is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs  helps you focus on your business logic while building RESTful APIs without having to worry about the various approaches to define request and response headers, status codes, HTTP methods, URL conventions, media types, payload formats, query options, etc.  provides metadata, a machine-readable description of the data model of the APIs, enables the creation of powerful generic client proxies and tools What is OData? (from odata.org)
  • 4. 4 Performance  New JSON Format (data): ~ 10% to 60% payload size reduction for lists after compression – No inline metadata (__metadata) – Messages part of payload (compressible) – V2 only header (not compressible)  Cross-Service Navigation: Lazy loading of huge service models Features  Improved type system: New data types (esp. in date/time area, e.g. Duration), inheritance, collection values  $filter with lambda operators ”any” and “all” for conditions on navigation properties People?$filter=Emails/any(a:endswith(a,'@example.com'))  $expand with query options People?$expand=Friends($filter=Emails/any(a:endswith(a,'@example.com')))  … and many more Why OData V4? Pro’s vs. OData V2 (Excerpt)
  • 5. Practice: OData V4 model features by example
  • 6. 6 Based on public OData V4 service http://services.odata.org/TripPinRESTierService  Do try this at home  Sample application
  • 7. 7 Initialize model as dataSource in manifest.json, mandatory settings  serviceUrl is the root URL of the service, e.g. “/odata_org/TripPinRESTierService/”  synchronizationMode (reserved for future enhancements); must be “None” Design principle: Data access via bindings  Binding path is OData resource path, e.g. “/People”  Binding parameters are – query options for request (e.g. $expand, $filter, …) – exception: $$-parameters  binding specific parameter to control binding behavior (e.g. $$groupId) (1) Model Instantiation and Data Access
  • 8. 8  Create app skeleton with manifest.json: Define dataSource for TripPin service , see also TripPin data model  Main.view.xml displays table on /People (First Name, Last Name, Age)  Show automatic paging ($top, $skip) for list binding Demo - (1) Model Instantiation and Data Access
  • 9. 9 Auto-type detection  Derive UI5 type from $metadata Formatting, parsing, validation between model value and UI value  Override by specifying type in binding information Binding mode: TwoWay is default  Changes to model written to service backend (2) Auto-type detection, data update
  • 10. 10  Validate with auto-detected types: Switch on validation in manifest.json (handleValidation)  Modify value in First Name (not nullable), Age (Int64): Show validation incl. language dependent error message  Show $batch with PATCH in network which sends update to the backend Demo - (2) Auto-type detection, data update
  • 11. 11 Batch groups  Determine bundling of data service requests in a $batch POST request  “$auto”: requests are queued until just before rendering and then sent in one $batch (default)  “$direct”: requests are sent directly, no $batch  Name without $ prefix: "Deferred group", request triggered via submitBatch on model  Can be set for  Model: groupId, updateGroupId model settings  Binding: parameter $$groupId, $$updateGroupId Related APIs  resetChanges resets pending changes for a batch group or binding  hasPendingChanges checks for pending changes for complete model or one binding (3) Batch groups
  • 12. 12  Set model groupId to $direct (easier to look at read requests in browser dev tools) – Demo: Change from POST/$batch to direct GET in dev tools  Set model updateGroupId to “updatePeople”  “Save” button – triggers submitBatch(“updatePeople”) – sets view to busy until submitBatch returns to avoid input while request is being sent  Demo: no $batch on leaving input field, but only on save button  “Reset changes” button triggers resetChanges Demo - (3) Batch groups
  • 13. 13  Prerequisite for filter and sort: Model setting operationMode set to “Server”  Specify filter and sorter via  ODataListBinding APIs filter and sort which take a sap.ui.model.Filter/Sorter object  $filter, $orderby binding parameters. Changed with changeParameters API on binding. Useful if OData filter options not covered by UI5 Filter or if sort or filter values never change.  Filters can specify lambda operators ”any” and “all” for conditions on navigation properties  Set $count=true at ODataListBinding to retrieve inline count. Bind it in table header; note: use headerContext! (4) Filtering and sorting, bind $count
  • 14. 14  Sort on “Last name” column via button in column header; iterate sort order "", "asc", "desc“  Filter on “Last name”: Use changeParameters for infix search $filter = contains(tolower(LastName),‘<input’)  Demo: resulting requests in dev tools Demo - (4) Filtering and sorting
  • 15. 15  OData V4 model computes $expand and $select for OData requests from UI  Benefits  Performance: Only load data required for UI  Convenience: No need to specify $expand manually as binding parameter  Switch on with model setting autoExpandSelect : true  Auto-$select of key properties: required for write requests on entity  Hard-coded $select and $expand binding parameters are merged  Feature released with OpenUI5 1.48 (5) Auto-$expand/$select
  • 16. 16 Without auto-$expand/$select …/People Uncompressed size: 8.5 kB (5) Auto-$expand/$select: response size comparison With auto-$expand/$select …/People?$select=Age,FirstName,LastName,UserN ame Uncompressed size: 2.0 kB
  • 17. 17 Support actions (side effects on server) and functions (no side effects) via "operation binding“  ODataContextBinding with path “<operation name>()”  Deferred operation with ellipsis “<operation name>(...)”  execution triggered via API  Actions must be deferred as they have side-effects  Bound operation’s “binding parameter” defined by context of relative operation binding APIs  setParameter  execute for deferred operation  refresh (6) OData operations and refresh
  • 18. 18  Button "Reset Data" calls action import via operation binding with path “/ResetDataSource(...)” – execute success: show success message and refresh the model to see the data reset – execute failure: show error message  Button “Refresh” calls refresh on model Demo - (6) OData operations and refresh
  • 19. 19 Create  Call create on ODataListBinding with given initial data Returns a context referring to the created entity  The resulting entity is "transient" until deleted or saved to the backend  The created method on the context provides a promise which is resolved when the entity is saved  Limitation: You have to call refresh before calling create again Delete  Delete an entity via delete on a context Returns a promise which allows for success and error handling. (7) Create and Delete
  • 20. 20  "Create" button calls the create API with hardcoded initial data; once the returned created promise is fulfilled, show a success message  Demo – “Save” button sends the POST – “Reset changes” button deletes the transient “People” instance – After “Save” and “Refresh”, a new entity can be created  “Delete” button calls delete for the context of the currently selected Person Demo - (7) Create and Delete
  • 22. Questions or feedback? Discuss with us in our „Meet the Expert” slot from 14 – 14:40
  • 23. Thank you. Contact information: Patric Ksinsik, p.ksinsik@sap.com Thomas Chadzelek, thomas.chadzelek@sap.com You are welcome to give feedback for this session in the UI5con Event App

Hinweis der Redaktion

  1. 0:50
  2. 0:20
  3. 1:10
  4. 2:20
  5. 0:20
  6. 0:40
  7. 2:30
  8. 1:00