London RADStudio1031 MarcoCantu

Download as pdf or txt
Download as pdf or txt
You are on page 1of 129

UK IRELAND

[email protected] [email protected]
+44 (0) 1364 655 123 +353 1 566 7508
www.greymatter.com www.greymatter.ie

RAD Studio 10.3.1 Live


with Marco Cantu

London, March 6th 2019


Your Presenter:

Marco Cantu’
RAD Studio Product Manager

[email protected]
@marcocantu
Today’s Agenda
•  Introduction by Grey Matter
•  9:00-11:15am
RAD Studio Product Roadmap
•  11:15-11:30am
Break / refreshments
•  11:30am-1:15pm
Modernising Delphi Applications and Architectures
Idera Inc. Developer Tools
•  RAD Studio, C++Builder, Delphi, InterBase, RAD Server

•  ExtJS, ExtReact, GXT, Sencha Test

•  JavaScript Web Editor

•  Visual Assist for Visual C++

•  Secure Git™, Secure Software Development in the


Cloud
•  LANSA, Low-Code Application Development
Part I: RAD Studio Modern Development
for Windows and Mobile
Part I: Content
•  Today’s Delphi and RAD Studio
•  Modern Delphi Language
•  Windows 10 Development Highlights
•  Single-Source Desktop and Mobile development with FireMonkey
What are Delphi and RAD Studio?
What is RAD Studio?

The fastest way to develop cross-platform native apps with


flexible cloud services and broad data connectivity

PLATFORM
CROSS INDEPENDENT
PLATFORM CLOUD READY
NATIVE
Fast, Visual Development

RAD Studio provides powerful VCL controls for Windows 10 and


enables FMX cross-platform development for Windows, Mac, iOS and
Android
RAD Studio Cornerstones

Native Delphi and C++ compilers for multiple platforms producing


optimized and secure applications
Flexible mix of Modern OOP and fast RAD development
Extensive focus on code migration to modern operating systems and
user interfaces
Enterprise and Data Centric architectures
Active Third-Party Vendors Ecosystem
10.3: RAD Studio Platforms
Windows 10 is King
●  The most
important
platform for our
current
customers

●  Add Windows 10
features without
breaking
Windows 7
compatibility Data by Stat Counter as of September 2018 -
http://gs.statcounter.com/windows-version-market-share/desktop/worldwide/#monthly-201609-201809
- CC-BY-SA 3.0 Unported license
Windows 10 is King
●  Windows 10 = key focus for RAD Studio

●  Rdcent VCL extensions for Hi-DPI and


4K monitors support
○  PerMonitorv2, multi-resolutions
image list, new APIs in 2018 flavor
of Windows 10

●  Additional WinRT API and Windows


Store support
VCL is the Best Solution for Windows 10

The best UI controls library for Windows


Includes direct access to Win32 APIs, COM Shell
Controls, WinRT new APIs
VCL controls corresponding common Windows 10 UI
elements (but not limited to Windows 10)
Style your existing VCL apps
Publish VCL apps on Windows Store via Desktop
Bridge
No dependency on any runtime or execution
environment (like .NET or Java)

16
Multi Device is the Future

Data by Stat Counter as of July 2018 -


http://gs.statcounter.com/os-market-share/desktop-mobile-tablet/worldwide/#yearly-2009-2018
- CC-BY-SA 3.0 Unported license
Platform Vendor Tools RAD Studio
Apple iOS Android Windows Single Project file

AndroidManifest.x Visual Studio


Info.plist
ml Project C++ or Pascal code

Swift or
Java or Kotlin C++ or C#
Objective-C FMX layout
Code Code
Code Android iOS
Variant Variant

NIB File Layout XAML Resources

FMX & RTL


Resources Resources Resources Libraries

Platform APIs
JNI & JDK
Cocoa APIs Windows APIs
Interface
One Project
4 Platforms
RAD Studio

Single Project file

C++ or Pascal code

FMX layout One Project


Android
Variant
iOS
Variant Every Platform
Resources

FMX & RTL Libraries


iOS &
Platform APIs macOS
Cross-platform is the Future
●  Cross-platform = key focus for RAD
Studio
○  FireUI multi device designer
○  FireUI preview on device
●  Styled and native controls
○  Native on Windows, iOS, and Android
● Support for
○  Android P with API level 26
○  iOS 12
RAD Studio Platform Support
Target the latest versions of major operating systems with one codebase!

macOS Mojave Linux 64-bit Android Pie iOS 12


October 2018 Update Ubuntu & Red Hat
Enterprise
(Delphi Only)

Officially Supporting
RAD Studio Family of Products
•  Two Programming Languages
•  Delphi language, Modern Object Pascal
•  C++Builder, Clang-enhanced C++17

•  RAD Studio
•  Bundle of both Delphi and C++Builder

•  Community Edition
•  Available for Delphi and C++Builder (not both combined)
•  Free for students etc. (more info later)
FireDAC High-Performance Data Access

High-performance, easy-to-use, enterprise database


connectivity, in-memory data caching and processing
Universal data access, with database specific features: No
drivers required and full source code provided
Works on all server and client platforms, mobile included
Integrated Cloud Services

AWS and Azure support


Access to storage, tables, queuing
Backend-as-a-Service (BaaS) providers
Including Parse API (now hosted by other vendors), Kinvey
REST and HTTP client libraries for direct access
Based on platform libraries, native HTTPS support
FireDAC NoSQL database access
Full support for MongoDB, on premise or in cloud
RAD Server
The Perfect Backend for Delphi and C++Builder (and ExtJS) Apps!
Implement RAD Server services in Delphi or C++Builder
Easy REST API End-Point Publishing
Server Metadata Publishing based on Swagger.io
Mobile Push Notifications
User/Group Management
API Usage Analytics
And much more

Turnkey solution for hosting your REST APIs


InterBase 2017: Embed, Deploy, Relax!
Self-tuning, High Performance SQL-92 Relational Database
Management System
Runs on Windows and Linux servers and embedded on desktop and
mobile
Developer edition integrated in RAD Studio

InterBase Server: IBLite/IBToGo:


Windows Windows
Linux MacOS
iOS
Android
Linux
Let’s Talk about Delphi
A Word on Delphi’s Popularity
•  Delphi was way ahead of its time at launch in 1995
•  Had incredible growth during the late ‘90s and early 2000
•  Now it has moderate growth by comparison
•  It may not be “trending” but it is still very relevant
•  Continues to grow with new features an improvements
•  Delphi has the best commitment to backwards compatibility

Your code is an investment and Delphi makes it


easier to move it forward and to new platforms
Why we Love Delphi…
•  Best language for productivity - it is easy to read and maintain
•  Best library for pure native performance and all platforms
•  Best Runtime Library for cross platform functionality
•  Easy access to platform APIs and libraries -“touch the metal”
•  Amazing 3rd party ecosystem
•  Components, tools, and libraries for anything and everything!
•  A commitment to backwards compatibility
•  Supports the latest platforms and technologies
•  Easy to use manual memory management
•  Working with all the best people
•  The best community, tech partners, and MVPs anywhere
New in 10.3 and 10.3.1
RAD Studio 10.2.x
Key features delivered in recent months:
●  Mobile (iOS and Android) added to the Professional edition
●  New VCL GUI controls and layouts
●  FMX & VCL QuickEdit designers
●  IDE Enhancements, including a Dark Theme
●  RAD Server enhancements for
Sencha EXT JS
●  Community Edition for Delphi
and C++Builder
10.3 Rio Key Features
●  C++ 17 for Win32
●  New Delphi Language Features
●  FireMonkey Android zOrder and API Level 26
●  Windows 10, VCL, and HighDPI improvements
●  Extensive IDE UI modernization
●  RAD Server architecture extension
●  Quality and Performance improvements
IDE UI Enhancements: Main Window
●  New Light and Dark styles, based on
blue brand colors
●  General cleanup: alignment, spacing
○  Everything where you expect,
but neater
○  Readable (eg code editor tabs)
○  Search (IDE Insight) on title bar
●  Better product first impression
●  Better for long-term use
●  Docwiki help also has a new theme
UI Enhancements: IDE & Project Options
●  UI cleanup: layout, alignment
○  Looks consistent
○  Spacing better for translation
○  Dependent settings clear and
obvious
●  Option location cleanup
○  Some categories renamed, some
options moved
○  Dialog-wide option search in title bar
Key IDE Quality Improvements
●  RAD Studio now requires .NET 4.x (rather than .NET 3.x)
●  Removed the RAD Studio Community Toolbar from the IDE
●  The installer now distributes the Windows 10 April 18 version
of the Windows SDK
●  Significantly improved LiveBindings designer performance
(aka. fixed the slow loading of large forms in the designer)
●  We incorporated some of Andreas’ “IDE Fix Pack” fixes/
improvements
●  Product demos are now shared on GitHub
IDE UI Enhancements: Other Dialogs
●  GetIt:
○ Scrolling list
○ Nicer look
●  New Items:
○ More modern look
●  Compile:
○ More modern look
○ Hint / warning /
error icons light
up, showing status
at a glance
Delphi Language Changes
●  Linux 64-bit compiler moves to non-ARC
○  Part of the new overall direction of removing ARC
■  Reasons: Performance, dual memory model complexity, cannot
move VCL to ARC
■  ARC still on for mobile compilers in 10.3
●  Side effect: AnsiString / AnsiChar available on Linux
●  Improved C++ compatibility
○  Changes in the way records between 4 and 8 bytes in size are passed
as parameters
●  Improved compiler performance
C++17
●  C++17 Clang-enhanced compiler and toolchain for Win32 (bcc32x and
bcc32c)
●  C++ runtime library (RTL) built with the updated Clang-enhanced compiler for
Win32, including 2018 edition of Dinkumware STL
●  Also includes support for C++14
●  Greatly improved code completion
○ Faster
○ Better results
○ Asynchronous, uses LSP
VCL High DPI Image List
●  New components
●  virtual image collection (holds images)
●  image list (DPI-aware specific view of
that collection)
●  Multi-resolution, alpha channel, 32bpp
bitmap / PNG (and can import old bitmaps)
●  List is compatible with TImageList (including
HIMAGELIST handle)
●  Image list scales as parent form DPI scales
●  Migration tools for old -> new lists
Windows 10 “Per Monitor v2” Support
●  PerMonitor v2 support in project options
○  Requires Windows 10 build 1703
“Creators Update” (from 5-April-2017)

●  New GetSystemMetrics model


○  GetSystemMetricsForWindow
○  TControl.GetSystemMetrics
○  Highly compatible with existing
source code

●  Significant focus on VCL High-DPI Fixes


Windows 10 API Enhancements
●  New native Win32/Win64 APIs
○  High-DPI area
○  WM_POINTER area (pen support)

●  Updated Object Pascal headers to the latest WinRT API


○  A dozen additional WinRT units

●  New TWindowsStore component -- for Desktop Bridge applications


○  Manage paid apps
○  In-app purchase
○  Trial mode
Android API Upgrade
RAD Studio 10.3 Rio includes support for Android API version 26
●  Required by Google for new Play Store applications starting August
2018 and for updates starting November 2018. Changes include:
○  New information in the manifest (with the proper API level)
○  The default configuration uses a recent version of the SDK/NDK
■  Requires installation of new SDK
○  Android permissions architecture redesigned
■  Might require changes to your code
Android New Permission Model
Recent versions of the Android API have changed the mechanism to request
permissions:
§  The user can call requestPermissions on the activity and the callback triggers
a RTL message subscription message
§  New relevant/related types imported into the RTL Android import units include
Manifest.permission and Build.VERSION in Androidapi.JNI.Os.pas,
ContextCompat, ActivityCompat, and PermissionChecker in
Androidapi.JNI.Support.pas.
Android Z-order and Native Controls
●  Easily mix styled and natively rendered controls
on the same form using the new Z-Order Support
○  Very similar to what we provide for Windows
and iOS today
●  Natively rendered components:
○  TSwitch
○  TEdit
○  TCalendar
○  TMultiView
●  TWebBrowser, TMapView etc. will use material
design theme on Android 5.0 or above
Enhanced iOS Support
•  Support for iOS 10, 11, 12 (Device and App
Store)

•  Support for the iOS 10 Simulator

•  Support for targeting new iPhone devices

** Features are not committed until completed and GA released


Delphi RTL Changes and Optimization
●  Data structures growth strategy modified (slower growth)
and configurable (can be replaced)
●  TStringBuilder improvements and performance
●  JSON improvements (and correctness)
●  Generics lists related improvements and performance
○  For example, TList<T>.Add is 3x faster
●  TMemIniFile performance improvement
●  Regular Expressions: PCRE with UTF-16 on Windows
●  The Zlib library has been updated to a newer version
New in FireDAC and Database
●  FireDAC drivers updates and improvements for
○  MySQL, MariaDB, SQL Server, PostgreSQL
○  Firebird, MongoDB, InterBase, SQLite, SQL Anywhere
●  TFDBatchMoveJSONWriter and optimized Batch Move
(10.2.x)
●  New TClientDataSet.IncludeBlobsInDelta
●  DataSnap
○  TDSRestConnection.SecureProtocols property
○  DataSnap REST uses "Content-Type=application/json"
HTTP and REST and Cloud
●  HTTP Client Library
○  Optimizations and improvements in multipart form data,
MIME types (TMimeType), Accept headers
●  REST Client Library
○  New events and properties in TRESTClient
●  SOAP clients use the HTTP client library
○  Better HTTPS support on mobile
●  Cloud
○  Azure storage emulator
○  AWS S3 support for recently added regions
RAD Server Enhancements
●  Performance enhancements and better memory management
●  New EndPoint Attributes for Content-Type and Accept based
URL mapping
●  HTTP Verb to Custom Method Name Mapping
●  Ability to Delegate Processing of a Request to a Custom Class
or Component
●  Ready-to-use components
for JSON processing
|datasets and files/folders
RAD Server Licensing
•  RAD Server development features are included in Enterprise
edition
•  Development / debug version of RAD Server with limited
development license is built into RAD Studio
•  Licenses for Apache and IIS deployment
•  Enterprise edition includes one free deployment single
server license
•  Architect edition includes a free deployment multi-site
license
RAD Studio 10.3 SKUs
RAD Studio 10.3 SKUs
•  Delphi Community Edition and C++Builder Community Edition

•  Professional Editions, including Mobile platforms


•  Includes IBLite (no hassle deployment)

•  Enterprise Editions
•  Include DataSnap, Full FireDAC support, RAD Server
•  Single Site RAD Server deployment
•  Now with IBToGo free deployment for mobile

•  Architect Editions — see next slide


10.3 Architect SKU Reinvented
•  Adding AquaFold Aqua Data Studio
•  General database management
•  Adding Sencha Ext JS Professional Edition
•  For building Web clients
•  Multi-site deployment for RAD Server
•  (Offer active since August 2018)
•  Ranorex Studio
•  Test Automation Tools (time-limited license)
•  Removing…
•  ER/Studio Developer Edition and DB PowerStudio developer edition
(existing customers retain their current license)
What’s New in 10.3.1

▪  Expanded support for iOS 12 and iPhone X series devices


▪  RAD Server Console UI redesign and migration to the Ext JS
framework
▪  Improved FireDAC support for Firebird 3.0.4 and Firebird embedded
▪  New VCL and FMX Multi-Device Styles
▪  IDE Productivity Components
▪  Fixes to over 150 customer reported bugs
Enhanced Support for iOS 12 & iPhone X series
•  Info.plist updates to account for new image
sizes
•  Additional app icon and splash screen sizes
supported from within the IDE (iPhone/iPad)
•  Designed to address Apple’s March 2019
requirement to fully support iOS 12 and iPhone
X series devices
RAD Server Console UI Redesign
•  UI Redesign for displaying RAD
Server analytics
•  Migrated from jQuery to Ext JS
•  Highlights the nice UI
capabilities
that Ext JS provides
•  Expanded push notification
support to target more devices
15 New VCL Windows and FMX Styles
10 new VCL Windows styles that users can
apply to their Windows applications
5 different FireMonkey multi-device styles
with theming support for Windows, macOS,
Android and iOS
Many of the styles come in different color
variants
Bitmap Style Designer templates
are also included
IDE Productivity Components
IDE Bookmarks
•  Bookmarks extend the IDE’s previous marking of
locations in the code editor
•  A single shortcut creates a new bookmark
•  Bookmarks in both the current and all files are
shown in a docked window
•  It also supports caret bookmarks, a stack of
locations you can jump backwards in by pressing
Escape
•  Available in GetIt
Former Parnassus plugin
IDE Productivity Components
IDE Navigator
•  Navigator allows you to quickly jump to
any location in your unit through
intelligent search for Delphi
•  Press Ctrl+G and start typing, and go to
the uses clause, any method, a
property, a property’s backing fields or
methods, and any other code element
•  It also adds a minimap for both Delphi
& C++, a side panel like a scrollbar
showing
a miniature version of your code
In Depth: Modern Delphi Language
Intro: The Delphi Language Today

•  Delphi language, also known as Object Pascal


•  Alive and kicking, very popular
•  Great heritage dating back to Borland Turbo Pascal
•  Continuously evolving with modern features
•  Currently shipping 8 Object Pascal compilers
•  Classic Compilers:
Win32, Win64, macOS 32, iOS Simulator 32
•  LLVM-based compilers:
iOS32, iOS64, Android 32, Linux 64
A Definition of the Delphi language

“Power and simplicity, expressiveness and readability, great for


learning and for professional development alike, these are some of
the traits of today's Object Pascal.”

“A tool for all trades, with compilers and development tools


embracing the mobile era. A language ready for the future, but with
solid roots in the past.”

Source Object Pascal Handbook, Marco Cantù, 2014


Delphi Language History in 3 Dates

•  1983 Turbo Pascal


•  When everything started

•  1995 Delphi’s Object Pascal


•  1995 was the year of programming languages, including Java, JavaScript,
PHP and Ruby

•  2009 Modern Object Pascal


•  With generics, anonymous methods, reflection, attributes

•  And now (2018): Inline variables and type inference


Modern Object Pascal

•  Not just additional language features, but additional


programming model beyond OOP
•  Generic types
•  For classes, records, interfaces

•  Anonymous methods or closures


•  Extended RTTI or reflection
•  Along with custom attributes

•  And more coming


Modern Object Pascal

•  Parameterized types (a type as parameter)


•  Generics are not for collections only
•  Generic methods in plain classes
•  First case of type inference in the language
•  GenericMethod Demo

•  Smart pointers example


•  Automatic management of an object lifetime
•  SmartPointers Demo
Interface References Revisited

•  [weak] references for interfaces on all platforms


•  Managed references that don’t add to the reference count
•  Helps with reference cycles

•  [unsafe] interface references, too


•  Unmanaged references
Inline Variables (New in 10.3)
●  Inline variables and constants declarations, direct assignment of
value at inline variable declaration point, block scope…
begin
var s: string := 20.ToString();
for var I: Integer := 1 to 100 do ...

●  Type inference for inline variables


var aDict := TDictionary<Integer, string>.Create;
Inline Variables Declaration
•  Inline var
•  Multiple variables of the same time
•  Declare and initialize
•  Same for inline const

•  Type inference
•  Value determines type
•  “Integer” default for (smaller) numeric values

•  Inline for and for-in loop variables


Inline Variables Declaration
•  Not just syntax sugar
•  It helps improve code correctness, avoid uninitialized variables and
no-longer-to-be used variables

•  Effect on performance?
•  InlineVarSpeed demo

•  Extended type inference


•  MoreTypeInference Demo

•  Block scope and lifetime


•  BlockScope Demo (with Smart Pointers)
Other Changes
•  ARC removed from the Linux Platform
•  Plan is to phase ARC out of the language in 10.4
•  Reasons: VCL code compatibility, unified model across platforms, performance
penalty
•  (Side effect) AnsiString on Linux, use with care

•  New warning for undefined attributes


•  And a new way to turn it into an error

•  Changes to 8 byte params calling convention


•  Quality fixes and for-in loop optimizations
Delphi Language Plans
•  In the works
•  Managed records (was enabled in 10.3 Beta, not stable enough)
•  Nullable types
•  More syntax enhancements

•  Plus additional platforms (LLVM-compiler based)


•  macOS 64
•  Android 64
Summary

•  The Delphi language has a long history, continues to


evolve, and has a bright future

•  Great modern multi-platform language, with fast compile


time and great runtime performance

•  24 years and counting!


In Depth: Windows 10 Development
Core Windows 10
Windows 10 is a mix of technologies:
1.  Core “classic” Win32/Win64 API Offers compatibility for existing applications
2.  COM and Shell integration
3.  New Windows 10 WinRT APIs Works exclusively on Windows 10, no Win7
compatibility

Microsoft/Windows Store supports WinRT


Supports also classic apps and the mix via Desktop Bridge
VCL and Windows 10
VCL offers you a great solution (and a migration path)
Support of all three APIs (classic, COM, WinRT) with components for each
Adds “Win10” look alike VCL controls
Highly compatibility with Windows 7
Includes Custom UI styling
With Win10 styles available also for older versions
RAD Studio integrates Desktop Bridge support
VCL Foundations revisited
•  VCL is the best OOP component library encapsulating Win API
•  Microsoft has MFC, WinForms
•  VCL has deep and smooth COM integration
•  Now VCL has first class support for the new WinRT API
•  Can mix and match with WinAPI code
•  UWP / WinRT solutions require Win8/10, new code
What’s NEW in the VCL for Windows 10
•  Styling
•  Windows 10 specific styles
•  New VCL Components
•  5 components introduced in 10 Seattle, 2 in 10.1 Berlin, 4 in 10.2 Tokyo
•  2 new components in 10.3 Rio
•  Implemented in VCL, work also on Win7
•  Look like WinRT counterparts, but no dependency
VCL Styling
New Windows 10 VCL Styles
Windows 10
Windows 10 Blue
Windows 10 Dark
Windows 10 Green
Windows 10 Purple
Windows 10 Slate Gray
Recent New VCL Controls
VCL Split View – TSplitView
•  Similar to FMX MultiView
•  Adjustable behaviors, placements and style
•  Can contain any other controls
•  Animated expand and collapse

TSplitView
VCL Calendar control
Date and Time PIcker, More panels
VCL Relative Layout Panel – TRelativePanel
•  Controls position based on relative position
•  Set position via ControlCollection
•  Find child control with IndexOf()
•  Or at design time use properties
•  Align[xx]WithPanel: Boolean
•  Above: [Sibling]
•  Align[xx]With: [Sibling]
•  LeftOf: [Sibling]

http://docwiki.embarcadero.com/RADStudio/en/
Using_the_Relative_Panel
VCL Features You Might Have Missed
•  Direct2D Canvas
•  WIC support in TImage
•  Post-Windows XP VCL controls features
•  Buttons, progress bars, edits, list views, headers
•  Task Dialogs
•  Gestures and touch support

85
Challenges with High DPI and Multiple Monitors
Icons and text can be too small, too large, appear fuzzy
UIs need to scale according with the DPI of the target monitor
Individual monitors can have desktop scaling configured
System elements (scrollbars, check boxes, etc) need to adapt
Images and graphical elements should not scale up (getting blurred) but
be picked among multiple versions
Windows, High DPI, and Multiple Monitors
Windows 10 has support for multiple monitor, different DPIs
Dragging to new monitor triggers system messages
Windows support for High DPI has been changing
Each Windows 10 release has something new
“Per Monitor v2” -> new APIs offers system information per
monitor
Additional challenge:
Win32 standard and common controls and image lists are only
partially DPI aware (single image list, no scaling)
VCL and High DPI
Continuous work and improvements over years
Supports dragging among monitors
“Per Monitor v2” support (in 10.3) addresses issues with scaling of
system elements (requires recent Windows 10)
Multi-resolutions images supported with new image list components
(10.3)
VCL High DPI Image List
●  New components
○  image collection (holds images)
○  virtual image list (DPI-aware specific
view of that collection)
●  List is compatible with TImageList (including
HIMAGELIST handle)
●  Image list scales as parent form DPI scales
(that means, share an image collection, but
don’t share an image list between two forms
or place in data module)
●  Migration tools for old -> new lists
Windows 10 “Per Monitor v2” Support
●  PerMonitor v2 support in project options
○  Requires Windows 10 build 1703
“Creators Update” (from 5-April-2017)

●  New GetSystemMetrics model


○  GetSystemMetricsForWindow
○  TControl.GetSystemMetrics
○  Highly compatible with existing
source code

●  Also in 10.3: Significant focus on VCL


High-DPI Fixes
The Windows Desktop Bridge (aka Centennial)
•  The “bridge” packages Win32/Win64 applications as Universal
Windows Platforms app
•  APPX installation in Anniversary Update
•  Windows Store going to be opened up soon
•  The technology: single ZIP file with entire distribution, one click
install and uninstall, file system and registry virtualization
•  Mostly like mobile, Mac
Windows 10 Store support in IDE
Part II: Modernising Delphi
Applications and Architectures
Part II: Content
•  Leveraging FireDAC
•  Embracing Mobile and using Mobile with Desktop
•  Multitier with RAD Server
•  Cloud-Ready development
Leveraging FireDAC
What is FireDAC?
•  Modern universal data access
•  Leveraging the native database drivers specific features
•  Focus on performance
•  Smart automatic caching

96
What is FireDAC?
•  A set of Universal Data Access Components
•  for developing any database application
•  High-performance, easy-to-use, enterprise
connectivity
•  Universal Data Access
•  But with many database specific features
Key FireDAC Features
•  Data Access Engine
•  Foundation classes + TDataSet comps
•  High Performance Data Access
•  From Live Data Window to Array DML
•  Unified API
•  SQL abstraction and scripting
•  Unified errors and transactions
FireDAC Overview
Core FireDAC
•  TFDConnection
•  TFDQuery
•  TFDMemTable

•  Flexible Options system


•  Powerful data type mapping (connection or query level)
Migration to FireDAC
•  reFind
•  Scripts under samples / database folder

•  BDE migration
•  Script to replace configuration and components

•  Dbx migration
•  Script + special components

101
FireDAC = Amazing Database Access!
•  Works on all platforms & Supports most databases
•  Including NoSQL on MongoDB
•  Enterprise Connectors expands it further to the cloud!
•  Amazing Features + Top Performance
•  Unified interface with database specific control
•  TFDLocalSQL is so useful!
•  Run SQL queries locally on TDataSet descendants.
•  Simplify code with SQL to process sets of local data
•  Join queries between heterogeneous data sources.
•  Supports the INSERT/UPDATE/DELETE SQL commands as transactions and
savepoint
Single Source Mobile and Desktop
Not so very long ago . . .

●  First came Windows, ruling all the land


●  Later iPhone was king of the mobile
world
●  Now Android outsells iPhone and
macOS is a contender again!
●  Today we live in a multi-device
world . . .

Yes, DOS came before Windows, so did UNIX and CP/M, but we aren’t going back that far today.
Now What’s a Developer to do?

●  Mobile or iOS first (but there are more Androids!)


●  Then rewrite for the other platforms?
●  Even if you share some source you still
have multiple project files, and release
schedules
●  You are stuck playing release leapfrog!

#EmbarcaderoCE
Topic
I need- how
Problem
many tools & languages?
Java for Android Swift for iOS &
macOS

C# for
Windows

#EmbarcaderoCE
Topic
That’s- Where
how to Embarcadero
solve problem Comes In . .

●  Embarcadero’s Delphi & C++Builder are tools


for the multi-device world
○  One project gives you native apps for all four
platforms: Windows, iOS, Android, & macOS
○  Visual designer lets you design it once
○  Smart themes adapt the UI to correct platform
behaviors
○  Create platform specific variations to tweak
behavior on each platform if desired
○  Still with full access to platform APIs & 3rd party
libraries
●  RAD Studio combines Delphi & C++Builder into
one product
#EmbarcaderoCE
Supports all Three Layers of Development

●  Each layer builds on


previous
●  Higher layers provide
productivity benefits
●  Lower layers provide
more control of platform
●  Apps typically written with
a combination of layers
●  Delphi & C++Builder give
you easy access to all
#EmbarcaderoCE
layers!
No-Compromise Compiled Code
•  Both Delphi and C++ Builder compile to native code, for Intel or ARM
•  Most compilers based on LLVM infrastructure

•  No runtime needed
•  No dependency on execution environment (.NET, JVM)
•  No runtime compilation, JITer, or any other layer

•  Advantages
•  Fast, secure, xcopy deployment
UI Widgets: Styled vs. Native or Both
•  Multi-platforms solutions offer
•  Styled (painted) controls only – often not even matching the platform
•  Native controls only – UI code changes significantly among platforms
•  “Forms” with a handful of controls

•  FireMonkey
•  Extensive collection of styles controls, with platform specific styles
(“pixel perfect”)
•  Key controls available as native controls (input controls and more)
•  Embedded complex native controls (maps, browser, etc.)
Best in Industry: FireUI Multi-Device Designer

Shared master and specific views


Visually customize forms for different platforms and form factors
Using Mobile with Desktop
Desktop First, Mobile Integrated
•  A common scenario for business apps
•  Keep the core business application on desktop
•  Surface features on mobile with focused apps, notifications, etc
•  Ideally, use a shared back end

•  Create companion apps via AppTethering


•  No server needed, just peer to peer to desktop app
Multitier with RAD Server
What is RAD Server in One Slide
•  The engine for multi-tier applications
•  Deploy on premise on in the cloud
•  Comes with tons of ready-to-use features: users and groups management, multi-
tenancy, detailed analytics, push notifications support, swagger documentation
support, beacon fencing…

•  Migrate your data access logic to a web service


•  Build flexible and thin Windows VCL clients, multi-device clients for
desktop and mobile or Web + JavaScript clients
•  Works on Windows and Linux, IIS and Apache (standalone not
recommended beyond development), Delphi and C++Builder
(Windows only)
Classic URL to Resource Mapping
•  RAD Server engine can load multiple customer pacakges
•  Each package defines multiple resources, each resource is mapped to a
URL
•  Classis mode: each resource (class or data module) implements HTTP
verbs by declaring matching methods for HTTP methods (GET, POST,
PUT, DELETE) plus a GET operation for the resource as a whole (LIST)
•  A server operation can return: JSON Value, any stream, JSONWriter –
and specify ContentType if not JSON
•  Addition: Direct mapping to files/folders (added in 10.2.x)
Classic and Not So-Classic Database Mapping
•  Manual approach: execute query, produce JSON in code, return
JSON
•  Semi-manual: execute FireDAC query, save the query as JSON
(internal format, not good for non-RAD clients)
•  Batch-Move: Use FireDAC batch move architecture for defining
custom mapping (added in 10.2.x)
Extended URL mapping in 10.3
•  Mapping goes beyond URL
•  EndpointProduce: MIME types for GET
•  Depends on Accept HTTP request header

•  EndpointConsume: MIME type for PUT/POST


•  Depends on Content-Type HTTP request header
•  Mapping to custom method names
•  Using attribute [EndpointMethod]
•  Delegate to class implementing IEMSEndpointPublisher
•  Generally requires [ResourceSuffix] declaration, filtering operations
Ready to Use Components
•  TEMSFileResource
•  Maps to folder
•  PathTemplate property indicates a path with {var} markers
•  Expanded using request params

•  TEMSDataSetResource
•  Maps to a dataset
•  Offers GET/POST/PUT/DELETE operations
•  LIST (Get /) including paging and sorting
•  Customize parameters to Keys mapping
RAD Server Summary
•  Rad Studio 10.3 has the “2.0” RAD Server, redesigned URL mapping
•  Bringing component based development to server side development
•  Reduce repetitive boilerplate code, focus on business logic and special processing
•  And deployment license is included in Enterprise (one site) and
Architect (multi site)
•  Plus, great back end for a JavaScript (and ExtJS) front end
Cloud Ready
Agenda: Delphi and The Cloud

Why Cloud Solutions Matter?


Accessing Services
Application Data on the Cloud
Cloud Hosting and Execution
A Database View of the World
•  Introducing CData Mobile Connectors
Delphi Access to Cloud Data

Options for direct HTTP access


•  Indy clients
•  HTTP Client Library
•  REST Client Library
Higher End Solutions
•  BaaS Connectors (Parse and Kinvey)
•  Cloud Services support (AWS and Azure)
•  Hosted MongoDB access
•  Third party controls and CData Connectors
Indy vs. HTTP lib vs. REST lib

Indy supports many protocols, client and server side


- Dependency on OpenSLL (app providing secutiry)
HTTP Client Library has core features
- Relies on platform SSL support
- Full support for customizing HTTP calls
REST Client Library abstracts HTTP lib
- Uses same core connectivity
- Includes table data mapping etc.
BaaS Support

Higher level support for core services of BaaS providers


Ready to use solution for Parse and Kinvey
Parse support shifted to open source Parse API
- Many different vendors host the Parse API these days
File Hosting

AWS and Azure offer files hosting (BLOBs)


DropBox API, Google Drive, and many others available
Cloud Databases

MongoDB FireDAC driver allows access to web-hosted DB


FireDAC drivers for Oracle, MySQL, MS SQL Server allow direct
access to cloud instances (hosted by Azure, AWS, Oracle, others)
AWS Tables and Azure Tables (light weight NoSQL DBs) support
More DBs available via CData connectors (see later)
Hosting Applications Alternatives

•  Virtual machines and related technologies


•  Amazon and Azure instances
•  Scalable containers (Linux)

•  The “Serverless” alternative


•  AWS Lambda
Questions?
[email protected]

You might also like