Mobile Apps with ColdFusion

  • View
    3.786

  • Download
    3

Embed Size (px)

DESCRIPTION

CFAir synch

Text of Mobile Apps with ColdFusion

  • 1. Terry Ryan | Evangelist
    Building ColdFusion Powered Mobile Applications
    Developer WeekJune 20 June 24, 2011

2. Assumptions
You know a little ColdFusion
You know a little Flex
You know what AIR is
Youve heard about AIR on Mobile Devices
2
3. What is this about?
Building ColdFusion Powered Mobile Applications
More specifically
ColdFusion support for data in mobile apps.
3
4. Review
4
5. ColdFusion - Do you know what a CFC is?
ColdFusion Component
Collection of Functions
Functions
Have Scope remote, public, package, and private
Remote means accessible to the world remotely through a webservice
Remote Access
Plain Text
WDDX
JSON
AMF or Flash Remoting
5
6. Flex Do you know what a remote object is?
RemoteObject
Remote Server call
Uses AMF
AMF
Client requests data
Server converts from server objects to ActionScript objects
Server transmits binary objects to requesting client
6
7. Mobile Apps = AIR
7
8. AIR for Devices
app.bar
app.apk
app.ipa
9. AIR and SQLite
AIR uses SQLite for offline data access
SQLite is tiny footprint database
Used in
Native IOS
Native Android
9
10. Application We are building
Staff information for my immediate team
1 table
Person information
10
11. Demo Backend Code
11
12. Approaches to Mobile Data
Mobile only (Not Covered)
Network Only
Read only cache
Sync-ablecache
12
13. Network Only
Backend Server has database
User requests data
Mobile App requests data
Mobile App presents it directly to user
13
14. Network Only
14
Remote
Object
Service
15. Demo Network Only
15
16. Network Only
Pros
Easy to write
Simple Apps
Cons
Good For
Demo apps
Proof of Concepts
Stale data worse then no data
Have to be connected to network
No interactivity
Take away
You just turned your app in to a dumbed down browser
17. Read Only Cache
Backend Server has database
Mobile App has database
User requests data
Mobile app presents data from its database
Mobile App requests data
Mobile App overwrites all its data.
17
18. Read Only Cache
18
DAO
Service
Remote
Object
19. Demo Read Only Cache
19
20. Read only Cache
Pros
Moderately easyto write
Allows offline access
Cons
Good For
Consumption apps
Stop gap app
No interactivity
Take aways
Better then network only
Still limited
Might be right for your users
21. Synch-able Cache
Backend Server has database
Mobile App has database
User requests/alters data
Mobile app presents/alters data from/for its database
Mobile App synchs all its data.
Mobile app and server manage conflicts
21
22. CF AIR Synch
ColdFusion 9 Introduced AIR Offline support
You write a sychmanager that matched ISynchmanager interface
You include cfair.swc in your Flex
22
23. Synch-able Cache
23
Main
Synch
Manager
Service
24. Demo Synch-able Cache
24
25. Synch-able Cache
Pros
This is a real app
Much easier then writing all of that code
Cons
Good For
Real apps
So complex to write, simplified version is still complex
Code is obscured
Take aways
Might work for you
Still might have to roll your own
26. Tips
26
27. Sometimes you have to manually cast
DAO
CFAIR Synch
27
28. Watch out for circular references
ORM with relationships
Copy ColdFusion ORM and remove relationships
28
29. App should only present local
All app data should be displayed from local
App should only synch to server
29
30. Prepare databases
Ship apps with prepopulated databases
30
31. Use Asynchronous Database calls
Little harder then you are used to
But allows for responsive apps.
31
32. 32
Downloadadobe.com/go/try_flashbuilder
adobe.com/go/coldfusion
Learnadobe.com/devnet/flex
adobe.com/devnet/coldfusion
33. 33
Codehttp://bitly.com/bundles/tpryan/2