Mobile Apps with ColdFusion


Published on

CFAir synch

Published in: Technology
1 Comment
  • Hi Terry,

    Great demo, thanks for it.
    I am building a basic iPhone APP that a user need to login and check list of products, like a book store. I am using Adobe Flash Builder and consuming Coldfusion 9, web service (CFC+XML) with Flex, making it very slow. Is it possible to write a FLEX web service under Coldfusion Server or is there a better way of communicating between iPhone and Coldfusion server?
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • You develop with AIR but it creates an apk file that is distributable on any market. It requires the AIR runtime, but makes it easy for someone to get if they need it.
  • Mobile Apps with ColdFusion

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