EMBARCADEROEMBARCADERO TECHNOLOGIESTECHNOLOGIESArchitecting C++ apps
with a multi-device application
platform

John “JT” Thomas
Director of Product Management
jt@embarcadero.com@FireMonkeyPM
blogs.embarcadero.com/jtembarcadero/

EMBARCADERO TECHNOLOGIESWhat is a multi-device application platform?
• Supports multiple client operating systems and formfactors• Manages data efficiently• Exposes the Enterprise securely• Integrates social and web services
2

EMBARCADERO TECHNOLOGIESMulti-Device Application Platform
MiddleWareClientDevices

Web andSocial Services

DatabaseEMBARCADERO TECHNOLOGIESMultiple client OSs and form factors
MiddleWare
ClientDevices

UI

Web andSocial Services

DatabaseEMBARCADERO TECHNOLOGIES

Efficient and Secure Data
MiddleWare
ClientDevices

Web andSocial Services

DatabaseEMBARCADERO TECHNOLOGIES

Securely Exposed Enterprise
Database

MiddleWare
ENTERPRISE
ClientDevices

Web andSocial Services

EMBARCADERO TECHNOLOGIES

Integrated web and social services
MiddleWare
ClientDevices
CLOUD

Web andSocial Services

DatabaseEMBARCADERO TECHNOLOGIESAPI

Description

UI
DATA
ENTEPRISE
CLOUD
8Embarcadero Technology

Windows
Mac OS X
iOS
Android*FireMonkey

Storage
SQL
Encryption
On DevicePrivate Cloud Service
Public Cloud ServiceInterBase

Enterprise Data Service
Private API Hosting

DataSnap
FireDACREST Connectivety
Web (Public) API Service
Social Network Integration
Mobile Backend as a Service

REST FMEMBARCADEROEMBARCADERO TECHNOLOGIESTECHNOLOGIESUIFIREMONKEY

9EMBARCADERO TECHNOLOGIESMulti-Device with RAD Studio XE5
One team
one codebase$C++ Source CodeFM Application
Platform

FutureEMBARCADERO TECHNOLOGIES

True Native Code•

True native apps in RAD Studio are script-free and run directly on hardware
CPU delivering the following advantages:– Fast – Uncompromised native device performance with full native API andCPU control when needed, and not limited by or slowed by scriptinterpreters and VMs.
– Predictable – Apps run directly on the device CPU, as intended by thedevice vendors, and are not slowed by additional software layers andrandom garbage collection.
– Better User Experience (UX) – Apps take full advantage of device
capabilities and performance.

The Fastest Way to develop
Windows, Mac OS X and iOS apps in C++

EMBARCADERO TECHNOLOGIESEMBARCADEROEMBARCADERO TECHNOLOGIESTECHNOLOGIESDATAINTERBASE

13EMBARCADERO TECHNOLOGIESOn Device Embedded Databases
SQLiteIBLiteInterBase ToGoFreeFreeCommercial

Feature light

Feature light

Fully featured

No security

No security

Secure Encryption

Simple Data Storage

Full SQL-92 RDBMSFull SQL-92 RDBMSSingle read/write

Fast multi read/write

Fast multi read/write

EMBARCADEROEMBARCADERO TECHNOLOGIESTECHNOLOGIESENTERPRISE
FIREDACDATASNAP
15EMBARCADERO TECHNOLOGIESFireDAC• A set of Universal Data Access Components• for developing any database application• for Delphi and C++Builder• High-performance, easy-to-use, enterpriseconnectivity• Universal Data Access• With many database specific features

EMBARCADERO TECHNOLOGIESEnterprise ReadyYourAppFMFireDAC

InterBaseor SQLLite

DataSnap
ServerMethods
C++ orDelphi

FireDAC

OracleMSSQL
DB2Sybase& more...

Device17

EMBARCADERO TECHNOLOGIESVisual LiveBindings• Bind controls to data
• Rapid Prototyping

EMBARCADERO TECHNOLOGIESMultitier with DataSnap• Accessing remote on-premise or cloud-hosted
services via REST/JSON or SOAP
• Connecting to Enterprise data from a mobile device

Delphi for mobile app

DataSnap ServerDatabase

EMBARCADERO TECHNOLOGIES

DataSnap Usage Metrics

EMBARCADERO TECHNOLOGIES

DataSnap app types

EMBARCADERO TECHNOLOGIES

DataSnap Best Practice• HTTP REST connectivity• ISAPI / Microsoft IIS• Asynchronous, session-less connections– Provides the highest scalability and load balancing support

EMBARCADERO TECHNOLOGIESType of DataSnap Server / Project• DataSnap REST App and WebBroker App use thesame infrastructure– Different default options,
JavaScript deployment• Use IIS as target– But development can be done with a local Indy server(best for debugging)– Indy throughput can be improved with thread caching

EMBARCADERO TECHNOLOGIESIIS vs. Indy Throughput

EMBARCADERO TECHNOLOGIESTDSServerClass LifeCycle Options• Server lifecycle only for global objects– Need to be protected against concurrent access• Session lifecycle– For a REST application falls back to invocation• Invocation lifecycle– This is the fully stateless approach, recommended forbetter scalability– User database connection caching / data caching if neededEMBARCADERO TECHNOLOGIESConfiguration of Application Layer• Delphi open to different alternatives– Subject to the application approach and architecture• Simpler logic or business logic in SQL layer, justhandle datasets directly• More complex business logic could benefit from anobject layer (ORM)• FireDAC is the recommended data access technology

EMBARCADERO TECHNOLOGIES

Data Set Caching in Middle Tier
• Global vs. Session data
– If there are two many sessions, session data can grow– Session data prevents load balancing on multiple server• Read-only vs. Read-Write data
– Read only: concurrent access is quite simple– Read-write: must implement concurrency, transaction,persistence in case of crashes, write conflicts… which adatabase does for you

EMBARCADERO TECHNOLOGIESCaching and Optimizations• HTTP level caching– Return the same response for a given time
• (in DataSnap or Web Server level ie. IIS)

• Client caching / delta request– Client can keep data around, query for updates rather than completetables• Speed database connection– Proximity (high speed connection)– Connection caching– RDBMS access generally much faster than remote client accessEMBARCADEROEMBARCADERO TECHNOLOGIESTECHNOLOGIESCLOUDREST FM29

EMBARCADERO TECHNOLOGIESXE5 Rest Client Stack• REST components– For developing REST client application• RESTDemos.exe• Uses REST components to access a few differentproviders• RESTDebugger.exe– Uses REST components to execute ad hoc requests

EMBARCADERO TECHNOLOGIESREST component features••••

Comprehensive HTTP client– Asynchronous execution– Proxy connection– HTTPS
Authentication– Basic, OAuth1, OAuth2
JSON– Parsing, Formatting– JSON to TObject, TObject to JSONRapid Prototyping– LiveBindings– Design time execution

EMBARCADERO TECHNOLOGIES

Deliver truly connected applications
With C++Builder’s MultiDevice Application Platform,
you can deliver truly
connected applications that
support real timecommunication and accessto enterprise data and cloudservices.

32

The Client Revolution

EMBARCADERO TECHNOLOGIESAn Unprecedented Multi-Device LandscapeEMBARCADEROEMBARCADERO TECHNOLOGIESTECHNOLOGIESQuestions
どうもありがとうございました。
Doumo Arigatou Gozaimashita