+ A Look at CFAjax Stephen Rittler CounterMarch Systems June 28th – July 1st 2006
Agenda Background and Setup Simple Usage (Demo) Using Templates Security Plan for the Future June 28th – July 1st 2006
about:steve Part of the CF community since 1999 Certified Advanced CF Developer Certified Flash MX 2004 Developer Manager of the Philadelphia CFUG Head over heels with Flex Also, Belgian beer June 28th – July 1st 2006
What is Ajax? Asynchronous JavaScript and XML Leverages HTML / XHTML, CSS, DOM, XML, XSLT, and XMLHttpRequest Obligatory mention of “Web 2.0” June 28th – July 1st 2006
Roles and Responsibilities Javascript Collects data, transparently sends it to the server on certain user-events Does something with returned data UI manipulation, user notification Back-End (CF, Java, .NET, PHP, Ruby) Does actual work June 28th – July 1st 2006
Process Flow Image swiped from Informit.com June 28th – July 1st 2006
ColdFusion Implementations CFAjax http://www.indiankey.com/cfajax/ ajaxCFC http://www.robgonda.com/blog/projects/ajaxcfc/ Plugin for Model-Glue June 28th – July 1st 2006
Setting up CFAjax Server Side: CF 6.0 and above Client Side Javascript Enabled XMLHttp object supported Can return (3 Complex Data Types): Struct Query Array June 28th – July 1st 2006
Simple Demonstration Just thinking out loud here, if you were going to show a demo, there might not be a better time than this slide. So maybe you should do that now. But what do I know? I’m just a PowerPoint presentation. June 28th – July 1st 2006
Simplicity is Nice Granular data in, granular data out Human readable (mostly) Consistent process flow June 28th – July 1st 2006
Problems of Simple Approach DOM Manipulation Thought of IE and DOM manipulation should make you queasy Do you really want to put HTML markup in Javascript? Our Solution (ymmv) Templates June 28th – July 1st 2006
Templates Pros: Cons: Returning HTML No hardcore DOM work Easy. Very easy. Very, very easy… Cons: Feels very dirty Requires a second “Controller” to encapsulate view logic June 28th – July 1st 2006
Security MySpace.com hack: Solutions: http://fast.info/myspace/ Gateway concept Plugins for frameworks (ajaxCFC for MG, etc.) June 28th – July 1st 2006
Emerging Trends Flex / Ajax Combination Mobile Ajax Apps http://coenraets.org/ Mobile Ajax Apps June 28th – July 1st 2006
Thank you! This presentation and sample code: http://www.countermarch.com/go/cfunited http://www.indiankey.com/cfajax/wiki/ http://www.robgonda.com/blog Character encoding: http://xkr.us/articles/javascript/encode-compare/ June 28th – July 1st 2006
Resources June 28th – July 1st 2006