SlideShare une entreprise Scribd logo
1  sur  73
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
A-Team Mobile Persistence
Accelerator (AMPA)
Superior productivity in building MAF applications
Steven Davelaar
@stevendavelaar
Oracle Mobile & Cloud A-Team
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
What matters when building mobile apps
• User Experience
– Work in Offline Mode
• Performance
• Developer Productivity
2
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
How AMPA helps
• User Experience
– People can work in offline mode, no reliance on network connectivity
• Performance
– Advanced data caching mechanism
– Show on-device data immediately
– Costly remote server calls performed in background
• Development productivity
– Wizards and runtime lib significantly reduce coding effort
– Fast debugging of REST calls
– Generation of CRUD user interface for easy testing
3
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
What is AMPA?
• Lightweight persistence framework that works on top of MAF
• Declarative consumption of REST-JSON services
• Significantly speeds up implementation of data caching and data
synching
• Available as open source framework hosted on GitHub
• Support through OTN MAF discussion forum
• Ideas and features from this project will be included in the MAF
product over time.
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Oracle MAF Architecture
Device
Services
PhoneGap/
Cordova
Device Native Container
Web
View
Server
HTML
ADF Mobile
AMX View
Third Party
Web Sites
Server or Cloud backend
Oracle IDM
Oracle IAM
Mobile
Device
Local
HTML
HTML5 & JavaScript Presentation
Configuration
Server
ADF Controller
CredentialManagement,
SSO&AccessControl
App
Config Server
SOAP & REST
Web Services
Java VM
Business Logic
ADF Model
Encrypted
SQLite DB
JDBC SQLite
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Java VM on Device
Runtime Persistence Architecture
DepartmentService
Data Control
Department
DepartmentServiceEntityCRUDService
extends
DBPersistence
Manager
Persistence
Mapping XML
DEPARTMENTS
table
SQLite
uses
JDBC
Statements
references
REST(JSON)
REST-JSON
PersistenceManager
HTTP
Requests
AMPA Fwk classes
Generated by AMPA Wizards
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Local and Remote Persistence
• AMPA runtime library contains generic Java code to perform CRUD
operations against SQLite database and against remote web services.
– Service objects extend EntityCRUDService class
– Service objects use DBPersistenceManager for CRUD operations against
SQLite database
– Service object can use a remote persistence manager for CRUD operations against
web service
• The generic code in EntityCRUDService class and persistence
managers is driven by metadata stored in persistence mapping XML file
• Persistence Managers are pluggable – create your own if needed
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
AMPA - JDeveloper Wizards
• Three wizards are provided to create the artefacts needed for this runtime
persistence architecture:
– Mobile Business Objects From REST Web Service Wizard
– Mobile Business Objects From SOAP Web Service Data Control Wizard (Deprecated,
REST performance is superior to SOAP, see next slides)
– Mobile Business Objects From Database Tables (Local persistence only)
• Another wizard is provided to generate a default CRUD user interface on
top of the business layer created by one of the above wizards.
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
SOAP vs REST for Mobile Applications
REST-JSON is 9x to 30x faster than SOAP!
Oracle Confidential –
9
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
SOAP vs REST for Mobile Applications
• Sample payload size
– 27 departments with 4 attributes and 107 nested employee attributes with 11
attributes
– Size in JSON format: 26.2 KB
– Size in XML format: 77.3KB
• Performance diff is NOT JUST caused by payload size
– XML parsing is CPU intensive and slow in MAF
– SOAP datacontrol requires reading and parsing many more files (wsdl, xsd)
• SOAP Data Control might be deprecated in future MAF version
– Too many performance issues / complaints
– Too many issues with complex SOAP services
10
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
A-Team Performance Study
http://www.ateam-oracle.com/performance-study-rest-vs-soap-for-mobile-applications/
11
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
MAF Development Process with AMPA
• Run AMPA wizard to create persistence layer artefacts
– Data objects and service classes
– Persistence mapping XML
– Sqlite DDL file to create table definitions
– Persistence configuration file
• Create Data Control(s) for Service Class(es)
• Create User Interface Layer
– Use drag and drop from Data Control Palette
– Use AMPA User Interface Generator Wizard
• Add business logic and UI logic
• Style the application to meet UI designs
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating On-Device Persistence Layer
• Use Oracle MCS RAML specification
• Execute Sample Resource Endpoints (server connection required)
• Use Oracle ADF BC REST Describe (server connection required)
• Specify Sample Payloads
AMPA Wizard – Persistence Creation Options
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |Copyright © 2015 Oracle and/or its affiliates. All rights reserved. 14
Demo:
Creating Persistence Layer using MCS RAML
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
MCS API Endpoints are stored in RAML file
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer – Sample Resource
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer – RAML File
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer – Data Objects
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer – Data Object Attributes
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer – Parent-Child Accessors
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer - CRUD Resources
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer – Resource Details
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer – Runtime Options
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating Persistence Layer – Generator Settings
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Persistence Layer Wizard - Output
• Data Object Java Classes
• Service Java Classes
• Persistence Mapping XML File
• SQL DDL File
• Persistence Configuration Properties File
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Generated Data Object Classes
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Generated Service Object Classes
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Generated SQL DDL Script
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Generated Persistence Mapping File
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Generated Persistence Mapping File
RESTful resource calls
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Generated Config File
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Configured InitDBLifecycleListener
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Create Data Control For Service Classes
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Creating the Mobile User Interface
• Build Using Drag and Drop
from DataControl Palette
• Generate Using MAF User
Interface Generator Wizard
– Generates feature, task flow,
AMX pages, managed beans,
etc
Two Options
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Building the User Interface – List View
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Building the User Interface – Quick Search
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Building the User Interface – Refresh List Data
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Building the User Interface – Create New Entity
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Building the User Interface – Remove Entity
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Building the User Interface – Save Changes
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Building the User Interface – Cancel Changes
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Building the User Interface – Master-Detail
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Using the MAF User Interface Generator
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Using the MAF User Interface Generator
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |Copyright © 2015 Oracle and/or its affiliates. All rights reserved. 47
Demo:
Generating UI Layer
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Generated User Interface Artefacts
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
AMPA - Offline Writes and Data Syncing
• If a remote persistence manager is configured, and CUD service call fails,
the service call is registered as “pending” data synch action
– Failure reason registered (device offline, service not available, etc)
• On next service call, the pending synch actions are processed first in order
of creation
– When failing again, the still pending synch action is updated with date of last synch
attempt and last error message
• Out-of-the-box feature: NO Java coding required
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Viewing Pending Data Sync Actions
• A reusable “DataSync” feature is provided that can be added to your
mobile application
• Register the feature in adfmf-application.xml
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Viewing Pending Data Synch Actions
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |Copyright © 2015 Oracle and/or its affiliates. All rights reserved. 52
Demo:
Offline Transactions and Syncing
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Notes on Data Sync Functionality
• Pending changes can become obsolete because of updates in server data
by other clients
– The server–side code should identify this and throw an error when the data sync
action sends stale data
– Stale data detection can be done by including a data revision number or ‘last-
modified” timestamp in payload. This number or timestamp should match with
server-side data record
• Data sync actions that keep failing need to be removed manually
– Local database might be out-of-sync, app needs to offer reconcile action
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
AMPA – MCS Support
• MCS Custom API
– Complete persistence layer created for Custom API Rest endpoints
– Supports offline reads and writes
• MCS Authentication
• MCS Analytics
– Easily send custom and system events
– Supports offline mode
• MCS Storage
– Easy read and write access to storage objects
– Support for reading and writing storage objects in offline mode
– Download file only if needed – check for changes using ETag header
• MCS Push Notifications
– (un)register device
• No need to use MAF-MCS Sample Utility
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
MCS Support – Sending Analytics Events
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
MCS Support – Register Device
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
• Create StorageObjectService Bean Data Control
– Drag and drop from data control palette
– No Java coding required
– No data object context
• Programmatic access
– Show file content in context of custom API data objects
– For example, Show employee picture with employee data
• File download in background or foreground
– Metadata stored in SQLite DB, file stored on file system
MCS Support – Show Storage Object Content
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Create StorageObjectService Data Control
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Using StorageObjectService Data Control
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Using StorageObjectService Data Control
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
MCS Support – Storage Object Programmatic Access
Retrieve employee images
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Using Employee Picture from Data Control
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
MCS Support – Storage Object Programmatic Access
Add File to MCS
https://github.com/oracle/mobile-
persistence/wiki/Developers-Guide
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
MCS Support – Storage Object Programmatic Access
Remove File from MCS
https://github.com/oracle/mobile-
persistence/wiki/Developers-Guide
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Debugging Support
• Show/Hide web service call errors in UI
– Configurable in persistence-mapping
• Log Rest call details
– Configurable in persistence-mapping
– Reusable feature to view REST calls at runtime
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Programmatic Access to SQLite DB
• AMPA provides DBPersistenceManager class to access SQLite DB
– Many convenience methods for CRUD operations
– No need to obtain DB connection yourself
• Custom SQL Queries can be specified in two ways
– At Data Object level using finder methods with attribute key-value pairs
– At SQL level by writing SQL statement yourself
– SELECT FROM clause can be created using convenience method
• SQL Query Results can be automatically converted to data object list
– Convenience method createEntitiesFromResultSet
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Programmatic Access to SQLite DB
Query using attribute key-value pairs
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Programmatic Access to SQLite DB
Query using custom SQL WHERE clause
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Programmatic Access to SQLite DB
Custom SQL Query
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Miscellaneous Features
• Encryption of database
• Auto-cleaning of unused database segments
• Lazy loading of child collections (a.k.a “Indirection”)
• Entity caching to minimize object creation
• Supports server-derived primary keys
– Temporary client key gets updated in DB and entity cache
• FindEntityByKey
– Checks cache first, then database
• Designed for customization
– Easy to override and extend default behavior
– Specify custom persistence managers in persistence-mapping.xml
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
More Info
• GitHub Wiki: github.com/oracle/mobile-persistence/wiki
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |
Summary
• Use MCS to design and implement a mobile-optimized REST API
• Use AMPA to declaratively consume the REST/JSON web services
• Use AMPA to implement data caching and syncing using the on-device
SQLite database
• Use AMPA to speed up user interface development and testing
• Think about how your end users should handle failed data sync actions,
and how to prevent updates based on stale data
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Contenu connexe

Tendances

Tendances (20)

Oracle ADF Architecture TV - Design - ADF BC Application Module Design
Oracle ADF Architecture TV - Design - ADF BC Application Module DesignOracle ADF Architecture TV - Design - ADF BC Application Module Design
Oracle ADF Architecture TV - Design - ADF BC Application Module Design
 
Oracle ADF Architecture TV - Design - Service Integration Architectures
Oracle ADF Architecture TV - Design - Service Integration ArchitecturesOracle ADF Architecture TV - Design - Service Integration Architectures
Oracle ADF Architecture TV - Design - Service Integration Architectures
 
Oracle ADF Architecture TV - Development - Naming Conventions & Project Layouts
Oracle ADF Architecture TV - Development - Naming Conventions & Project LayoutsOracle ADF Architecture TV - Development - Naming Conventions & Project Layouts
Oracle ADF Architecture TV - Development - Naming Conventions & Project Layouts
 
Let's Talk Mobile
Let's Talk MobileLet's Talk Mobile
Let's Talk Mobile
 
Oracle ADF Architecture TV - Design - ADF Service Architectures
Oracle ADF Architecture TV - Design - ADF Service ArchitecturesOracle ADF Architecture TV - Design - ADF Service Architectures
Oracle ADF Architecture TV - Design - ADF Service Architectures
 
Oracle ADF Architecture TV - Development - Error Handling
Oracle ADF Architecture TV - Development - Error HandlingOracle ADF Architecture TV - Development - Error Handling
Oracle ADF Architecture TV - Development - Error Handling
 
Oracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow OverviewOracle ADF Architecture TV - Design - Task Flow Overview
Oracle ADF Architecture TV - Design - Task Flow Overview
 
Oracle ADF Architecture TV - Design - ADF Reusable Artifacts
Oracle ADF Architecture TV - Design - ADF Reusable ArtifactsOracle ADF Architecture TV - Design - ADF Reusable Artifacts
Oracle ADF Architecture TV - Design - ADF Reusable Artifacts
 
Oracle ADF Architecture TV - Design - Task Flow Transaction Options
Oracle ADF Architecture TV - Design - Task Flow Transaction OptionsOracle ADF Architecture TV - Design - Task Flow Transaction Options
Oracle ADF Architecture TV - Design - Task Flow Transaction Options
 
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with OracleMobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
Mobile Mumbo Jumbo - Demystifying the World of Enterprise Mobility with Oracle
 
Programming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionappsProgramming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionapps
 
Oracle ADF Architecture TV - Design - Usability and Layout Design
Oracle ADF Architecture TV - Design - Usability and Layout DesignOracle ADF Architecture TV - Design - Usability and Layout Design
Oracle ADF Architecture TV - Design - Usability and Layout Design
 
Oracle ADF Architecture TV - Design - Task Flow Communication Pattern
Oracle ADF Architecture TV - Design - Task Flow Communication PatternOracle ADF Architecture TV - Design - Task Flow Communication Pattern
Oracle ADF Architecture TV - Design - Task Flow Communication Pattern
 
Oracle ADF Architecture TV - Deployment - Deployment Options
Oracle ADF Architecture TV - Deployment - Deployment OptionsOracle ADF Architecture TV - Deployment - Deployment Options
Oracle ADF Architecture TV - Deployment - Deployment Options
 
Oracle ADF Architecture TV - Design - Task Flow Data Control Scope Options
Oracle ADF Architecture TV - Design - Task Flow Data Control Scope OptionsOracle ADF Architecture TV - Design - Task Flow Data Control Scope Options
Oracle ADF Architecture TV - Design - Task Flow Data Control Scope Options
 
Data Caching Strategies for Oracle Mobile Application Framework
Data Caching Strategies for Oracle Mobile Application FrameworkData Caching Strategies for Oracle Mobile Application Framework
Data Caching Strategies for Oracle Mobile Application Framework
 
Oracle ADF Architecture TV - Deployment - Build Options
Oracle ADF Architecture TV - Deployment - Build OptionsOracle ADF Architecture TV - Deployment - Build Options
Oracle ADF Architecture TV - Deployment - Build Options
 
Oracle ADF Architecture TV - Design - ADF Architectural Patterns
Oracle ADF Architecture TV - Design - ADF Architectural PatternsOracle ADF Architecture TV - Design - ADF Architectural Patterns
Oracle ADF Architecture TV - Design - ADF Architectural Patterns
 
Oracle ADF Architecture TV - Development - Programming Best Practices
Oracle ADF Architecture TV - Development - Programming Best PracticesOracle ADF Architecture TV - Development - Programming Best Practices
Oracle ADF Architecture TV - Development - Programming Best Practices
 
Oracle ADF Architecture TV - Development - Performance & Tuning
Oracle ADF Architecture TV - Development - Performance & TuningOracle ADF Architecture TV - Development - Performance & Tuning
Oracle ADF Architecture TV - Development - Performance & Tuning
 

Similaire à A-Team Mobile Persistence Accelerator Overview

Apache Hadoop YARN: state of the union
Apache Hadoop YARN: state of the unionApache Hadoop YARN: state of the union
Apache Hadoop YARN: state of the union
DataWorks Summit
 

Similaire à A-Team Mobile Persistence Accelerator Overview (20)

Oracle Cloud
Oracle CloudOracle Cloud
Oracle Cloud
 
OUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
OUG Scotland 2014 - NoSQL and MySQL - The best of both worldsOUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
OUG Scotland 2014 - NoSQL and MySQL - The best of both worlds
 
Oracle JET overview
Oracle JET overviewOracle JET overview
Oracle JET overview
 
MySQL Fabric
MySQL FabricMySQL Fabric
MySQL Fabric
 
Netherlands Tech Tour 02 - MySQL Fabric
Netherlands Tech Tour 02 -   MySQL FabricNetherlands Tech Tour 02 -   MySQL Fabric
Netherlands Tech Tour 02 - MySQL Fabric
 
Enterprise manager 13c
Enterprise manager 13cEnterprise manager 13c
Enterprise manager 13c
 
RMOUG MySQL 5.7 New Features
RMOUG MySQL 5.7 New FeaturesRMOUG MySQL 5.7 New Features
RMOUG MySQL 5.7 New Features
 
MySQL in oracle public cloud
MySQL in oracle public cloudMySQL in oracle public cloud
MySQL in oracle public cloud
 
MySQL in oracle_public_cloud
MySQL in oracle_public_cloudMySQL in oracle_public_cloud
MySQL in oracle_public_cloud
 
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...
OOW16 - Oracle Enterprise Manager 13c Cloud Control for Managing Oracle E-Bus...
 
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptxODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
ODTUG_NoPlsql_vs_SmartDB_Part1_and_2.pptx
 
WebLogic 12c - OMF Canberra June 2014
WebLogic 12c - OMF Canberra June 2014WebLogic 12c - OMF Canberra June 2014
WebLogic 12c - OMF Canberra June 2014
 
Dataworks Berlin Summit 18' - Apache hadoop YARN State Of The Union
Dataworks Berlin Summit 18' - Apache hadoop YARN State Of The UnionDataworks Berlin Summit 18' - Apache hadoop YARN State Of The Union
Dataworks Berlin Summit 18' - Apache hadoop YARN State Of The Union
 
Apache Hadoop YARN: state of the union
Apache Hadoop YARN: state of the unionApache Hadoop YARN: state of the union
Apache Hadoop YARN: state of the union
 
Simplify IT: Oracle SuperCluster
Simplify IT: Oracle SuperCluster Simplify IT: Oracle SuperCluster
Simplify IT: Oracle SuperCluster
 
Latest Innovations in Database as a Service Enabled by Oracle Enterprise Manager
Latest Innovations in Database as a Service Enabled by Oracle Enterprise ManagerLatest Innovations in Database as a Service Enabled by Oracle Enterprise Manager
Latest Innovations in Database as a Service Enabled by Oracle Enterprise Manager
 
Java EE for the Cloud
Java EE for the CloudJava EE for the Cloud
Java EE for the Cloud
 
Oracle super cluster for oracle e business suite
Oracle super cluster for oracle e business suiteOracle super cluster for oracle e business suite
Oracle super cluster for oracle e business suite
 
MySQL London Tech Tour March 2015 - MySQL Fabric
MySQL London Tech Tour March 2015 - MySQL FabricMySQL London Tech Tour March 2015 - MySQL Fabric
MySQL London Tech Tour March 2015 - MySQL Fabric
 
What's New and Noteworthy on Oracle CAF 12.1.3
What's New and Noteworthy on Oracle CAF 12.1.3What's New and Noteworthy on Oracle CAF 12.1.3
What's New and Noteworthy on Oracle CAF 12.1.3
 

Dernier

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Dernier (6)

Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 

A-Team Mobile Persistence Accelerator Overview

  • 1. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | A-Team Mobile Persistence Accelerator (AMPA) Superior productivity in building MAF applications Steven Davelaar @stevendavelaar Oracle Mobile & Cloud A-Team
  • 2. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | What matters when building mobile apps • User Experience – Work in Offline Mode • Performance • Developer Productivity 2
  • 3. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | How AMPA helps • User Experience – People can work in offline mode, no reliance on network connectivity • Performance – Advanced data caching mechanism – Show on-device data immediately – Costly remote server calls performed in background • Development productivity – Wizards and runtime lib significantly reduce coding effort – Fast debugging of REST calls – Generation of CRUD user interface for easy testing 3
  • 4. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | What is AMPA? • Lightweight persistence framework that works on top of MAF • Declarative consumption of REST-JSON services • Significantly speeds up implementation of data caching and data synching • Available as open source framework hosted on GitHub • Support through OTN MAF discussion forum • Ideas and features from this project will be included in the MAF product over time.
  • 5. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Oracle MAF Architecture Device Services PhoneGap/ Cordova Device Native Container Web View Server HTML ADF Mobile AMX View Third Party Web Sites Server or Cloud backend Oracle IDM Oracle IAM Mobile Device Local HTML HTML5 & JavaScript Presentation Configuration Server ADF Controller CredentialManagement, SSO&AccessControl App Config Server SOAP & REST Web Services Java VM Business Logic ADF Model Encrypted SQLite DB JDBC SQLite
  • 6. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Java VM on Device Runtime Persistence Architecture DepartmentService Data Control Department DepartmentServiceEntityCRUDService extends DBPersistence Manager Persistence Mapping XML DEPARTMENTS table SQLite uses JDBC Statements references REST(JSON) REST-JSON PersistenceManager HTTP Requests AMPA Fwk classes Generated by AMPA Wizards
  • 7. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Local and Remote Persistence • AMPA runtime library contains generic Java code to perform CRUD operations against SQLite database and against remote web services. – Service objects extend EntityCRUDService class – Service objects use DBPersistenceManager for CRUD operations against SQLite database – Service object can use a remote persistence manager for CRUD operations against web service • The generic code in EntityCRUDService class and persistence managers is driven by metadata stored in persistence mapping XML file • Persistence Managers are pluggable – create your own if needed
  • 8. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | AMPA - JDeveloper Wizards • Three wizards are provided to create the artefacts needed for this runtime persistence architecture: – Mobile Business Objects From REST Web Service Wizard – Mobile Business Objects From SOAP Web Service Data Control Wizard (Deprecated, REST performance is superior to SOAP, see next slides) – Mobile Business Objects From Database Tables (Local persistence only) • Another wizard is provided to generate a default CRUD user interface on top of the business layer created by one of the above wizards.
  • 9. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | SOAP vs REST for Mobile Applications REST-JSON is 9x to 30x faster than SOAP! Oracle Confidential – 9
  • 10. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | SOAP vs REST for Mobile Applications • Sample payload size – 27 departments with 4 attributes and 107 nested employee attributes with 11 attributes – Size in JSON format: 26.2 KB – Size in XML format: 77.3KB • Performance diff is NOT JUST caused by payload size – XML parsing is CPU intensive and slow in MAF – SOAP datacontrol requires reading and parsing many more files (wsdl, xsd) • SOAP Data Control might be deprecated in future MAF version – Too many performance issues / complaints – Too many issues with complex SOAP services 10
  • 11. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | A-Team Performance Study http://www.ateam-oracle.com/performance-study-rest-vs-soap-for-mobile-applications/ 11
  • 12. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | MAF Development Process with AMPA • Run AMPA wizard to create persistence layer artefacts – Data objects and service classes – Persistence mapping XML – Sqlite DDL file to create table definitions – Persistence configuration file • Create Data Control(s) for Service Class(es) • Create User Interface Layer – Use drag and drop from Data Control Palette – Use AMPA User Interface Generator Wizard • Add business logic and UI logic • Style the application to meet UI designs
  • 13. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating On-Device Persistence Layer • Use Oracle MCS RAML specification • Execute Sample Resource Endpoints (server connection required) • Use Oracle ADF BC REST Describe (server connection required) • Specify Sample Payloads AMPA Wizard – Persistence Creation Options
  • 14. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |Copyright © 2015 Oracle and/or its affiliates. All rights reserved. 14 Demo: Creating Persistence Layer using MCS RAML
  • 15. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | MCS API Endpoints are stored in RAML file
  • 16. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer
  • 17. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer
  • 18. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer – Sample Resource
  • 19. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer – RAML File
  • 20. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer – Data Objects
  • 21. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer – Data Object Attributes
  • 22. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer – Parent-Child Accessors
  • 23. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer - CRUD Resources
  • 24. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer – Resource Details
  • 25. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer – Runtime Options
  • 26. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating Persistence Layer – Generator Settings
  • 27. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Persistence Layer Wizard - Output • Data Object Java Classes • Service Java Classes • Persistence Mapping XML File • SQL DDL File • Persistence Configuration Properties File
  • 28. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Generated Data Object Classes
  • 29. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Generated Service Object Classes
  • 30. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Generated SQL DDL Script
  • 31. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Generated Persistence Mapping File
  • 32. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Generated Persistence Mapping File RESTful resource calls
  • 33. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Generated Config File
  • 34. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Configured InitDBLifecycleListener
  • 35. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Create Data Control For Service Classes
  • 36. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Creating the Mobile User Interface • Build Using Drag and Drop from DataControl Palette • Generate Using MAF User Interface Generator Wizard – Generates feature, task flow, AMX pages, managed beans, etc Two Options
  • 37. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Building the User Interface – List View
  • 38. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Building the User Interface – Quick Search
  • 39. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Building the User Interface – Refresh List Data
  • 40. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Building the User Interface – Create New Entity
  • 41. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Building the User Interface – Remove Entity
  • 42. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Building the User Interface – Save Changes
  • 43. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Building the User Interface – Cancel Changes
  • 44. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Building the User Interface – Master-Detail
  • 45. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Using the MAF User Interface Generator
  • 46. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Using the MAF User Interface Generator
  • 47. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |Copyright © 2015 Oracle and/or its affiliates. All rights reserved. 47 Demo: Generating UI Layer
  • 48. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Generated User Interface Artefacts
  • 49. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | AMPA - Offline Writes and Data Syncing • If a remote persistence manager is configured, and CUD service call fails, the service call is registered as “pending” data synch action – Failure reason registered (device offline, service not available, etc) • On next service call, the pending synch actions are processed first in order of creation – When failing again, the still pending synch action is updated with date of last synch attempt and last error message • Out-of-the-box feature: NO Java coding required
  • 50. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Viewing Pending Data Sync Actions • A reusable “DataSync” feature is provided that can be added to your mobile application • Register the feature in adfmf-application.xml
  • 51. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Viewing Pending Data Synch Actions
  • 52. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |Copyright © 2015 Oracle and/or its affiliates. All rights reserved. 52 Demo: Offline Transactions and Syncing
  • 53. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Notes on Data Sync Functionality • Pending changes can become obsolete because of updates in server data by other clients – The server–side code should identify this and throw an error when the data sync action sends stale data – Stale data detection can be done by including a data revision number or ‘last- modified” timestamp in payload. This number or timestamp should match with server-side data record • Data sync actions that keep failing need to be removed manually – Local database might be out-of-sync, app needs to offer reconcile action
  • 54. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | AMPA – MCS Support • MCS Custom API – Complete persistence layer created for Custom API Rest endpoints – Supports offline reads and writes • MCS Authentication • MCS Analytics – Easily send custom and system events – Supports offline mode • MCS Storage – Easy read and write access to storage objects – Support for reading and writing storage objects in offline mode – Download file only if needed – check for changes using ETag header • MCS Push Notifications – (un)register device • No need to use MAF-MCS Sample Utility
  • 55. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | MCS Support – Sending Analytics Events
  • 56. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | MCS Support – Register Device
  • 57. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | • Create StorageObjectService Bean Data Control – Drag and drop from data control palette – No Java coding required – No data object context • Programmatic access – Show file content in context of custom API data objects – For example, Show employee picture with employee data • File download in background or foreground – Metadata stored in SQLite DB, file stored on file system MCS Support – Show Storage Object Content
  • 58. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Create StorageObjectService Data Control
  • 59. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Using StorageObjectService Data Control
  • 60. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Using StorageObjectService Data Control
  • 61. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | MCS Support – Storage Object Programmatic Access Retrieve employee images
  • 62. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Using Employee Picture from Data Control
  • 63. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | MCS Support – Storage Object Programmatic Access Add File to MCS https://github.com/oracle/mobile- persistence/wiki/Developers-Guide
  • 64. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | MCS Support – Storage Object Programmatic Access Remove File from MCS https://github.com/oracle/mobile- persistence/wiki/Developers-Guide
  • 65. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Debugging Support • Show/Hide web service call errors in UI – Configurable in persistence-mapping • Log Rest call details – Configurable in persistence-mapping – Reusable feature to view REST calls at runtime
  • 66. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Programmatic Access to SQLite DB • AMPA provides DBPersistenceManager class to access SQLite DB – Many convenience methods for CRUD operations – No need to obtain DB connection yourself • Custom SQL Queries can be specified in two ways – At Data Object level using finder methods with attribute key-value pairs – At SQL level by writing SQL statement yourself – SELECT FROM clause can be created using convenience method • SQL Query Results can be automatically converted to data object list – Convenience method createEntitiesFromResultSet
  • 67. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Programmatic Access to SQLite DB Query using attribute key-value pairs
  • 68. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Programmatic Access to SQLite DB Query using custom SQL WHERE clause
  • 69. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Programmatic Access to SQLite DB Custom SQL Query
  • 70. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Miscellaneous Features • Encryption of database • Auto-cleaning of unused database segments • Lazy loading of child collections (a.k.a “Indirection”) • Entity caching to minimize object creation • Supports server-derived primary keys – Temporary client key gets updated in DB and entity cache • FindEntityByKey – Checks cache first, then database • Designed for customization – Easy to override and extend default behavior – Specify custom persistence managers in persistence-mapping.xml
  • 71. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | More Info • GitHub Wiki: github.com/oracle/mobile-persistence/wiki
  • 72. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Summary • Use MCS to design and implement a mobile-optimized REST API • Use AMPA to declaratively consume the REST/JSON web services • Use AMPA to implement data caching and syncing using the on-device SQLite database • Use AMPA to speed up user interface development and testing • Think about how your end users should handle failed data sync actions, and how to prevent updates based on stale data
  • 73. Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Notes de l'éditeur

  1. This is a Title Slide with Picture and Logo slide ideal for including a picture and partner or product logo with a brief title, subtitle and presenter information. To customize this slide with your own picture: Right-click the slide area and choose Format Background from the pop-up menu. From the Fill menu, click Picture and texture fill. Under Insert from: click File. Locate your new picture and click Insert. To Replace the LOGO on this sample slide: Right-click the sample LOGO and choose Change Picture. Navigate to the location where the new logo is stored, select desired logo file and click on the Open button to replace the sample logo.
  2. Device Native Container: An application container or template compiled as device native application binary. This provides the runtime environment for an ADF Mobile application to run as an on-device, native application in the mobile device’s operation system (for example Apple iOS). Beyond hosting all of the client-side components for an ADF Mobile application, it also provides a couple of user interface navigation features: the Spring Board and the Tab Bar that allows user to navigate to a particular feature. Web View: Web View is a part of the Device Native container that leverages device’s web engine to display and process web-based content. In an ADF Mobile application, Web View is the primary mechanism to render and deliver the application user interface. Server HTML: Server HTML represents web-based user interface that are generated on the server and delivered as a web page to the ADF Mobile application. Generation of the HTML code occurs entirely on a remote server, as well as business and page flow logic. Server HTML can access device native services such as camera through the JavaScript API supported by Phone Gap, as long as it is running inside an ADF Mobile application. Common options for server HTML-based pages are ADF Mobile browser and ADF Faces Rich Client-based pages. Local HTML: Local HTML are web pages developed using JDeveloper or third-party tools/frameworks that are directly embedded within an ADF Mobile application. These pages are delivered as a part of the ADF Mobile application. Local HTML files can access device native features through the JavaScript APIs supported by the Phone Gap. ADF Mobile AMX Views: AMX views are based on the new AMX component that delivers JavaServer Faces-like development experience to developing HTML5-based user interface. Developers define AMX views using UI and code editors in the JDeveloper, and these views are embedded into the ADF Mobile applications and deployed to the device. During runtime, JavaScript Engine in the Web View renders AMX view definitions into HTML5 controls. AMX components are built to deliver mobile optimized user experiences out of box, and supports device native user experience through extensive animation and touch gesture support. ADF Controller: A mobile version of the ADF Controller that supports a subset of ADF Task Flow components available to a server-based ADF application. It supports both bounded and unbounded ADF Task Flows, and a subset of events/scopes that are supported by the server-based ADF. Java: Provides a Java Runtime environment for the ADF Mobile application. This Java Virtual Machine is implemented in device-native code, and is embedded/compiled into each instance of the ADF Mobile application as part of the native application binary. This JVM is based on the JavaME Connected Device Configuration (CDC) specification. Managed Beans: Managed Beans are Java classes that an ADF Mobile developer can write to extend the capabilities of the framework. This allows any ADF/Java developers to leverage existing development skills to program, for example, additional business logic necessary to process data returned from the server. Managed Beans are executed by the embedded Java support, and therefore must conform to the JavaME CDC specifications. ADF Model: ADF Model in an ADF Mobile application supports a subset of Business Logic components available to server-based ADF application. It contains the binding layer that provides an interface between the business logic components and user interface, as well as the execution logic to invoke REST or SOAP-based web services. Application Configuration: Refers to services that allows key application configurations to be downloaded and refreshed. For example, URL end points for a Web Services or Remote URL connection. Application configuration services downloads configuration information from WebDav-based server-side service. Credential Management, SSO, and Access Control: Refers to client-side services that provides security-related services for an ADF Mobile application. For example, a local credential store that securely caches user credentials to support offline authentication. Another example would be access control services that would show/hide application features based on user access. Phone Gap: Phone Gap is an open-sourced code library that provides a common JavaScript API/interface to access different device services such as the camera. Phone Gap provides majority of the device-services integration for an ADF Mobile application. Phone Gap JavaScript APIs are further abstracted as Device Data Controls in the JDeveloper Design Time for AMX-based views, allowing developers to integrate device services by simply dragging and dropping Data Controls to their AMX Views. Device Native Views: These are views written in device native language (for example Objective C for iOS), compiled as native libraries, and then incorporated into an ADF Mobile application. Device native views are to be used as rare exceptions when AMX or other web-based UI are not sufficient to fully support certain application functionality that only native code can deliver. For example, a view that requires intensive graphical processing support. Local Data: Refers to data stores that reside on the device – in ADF Mobile, these are implemented as encrypted SQLite databases. Full CRUD operations are supported to this local data store through the Java layer, using JDBC-based APIs. On the server side, the Configuration Server refers to a WebDav-based server that hosts configuration files used by the Applicaction Configuration services. The Configuration Server is delivered as a reference implementation/sample – developers and IT administrators can leverage any common WebDav services hosted on common J2EE server for this purpose.
  3. Service Object: A java class that returns collections of data objects. The actual implementation of the data retrieval can be JDBC to a SQLite database, access to REST-JSON objects via the restServiceAdapter class, or by invoking other data controls like a Web Service Data Control or URL Data Control to invoke SOAP or REST-XML web services. Service objects can also use another other java methods like file I/O to retrieve data as well.