-
Ben Nadel
-
Chief Software Engineer, Epicenter Consulting
-
Author of The Blog of Ben Nadel (www.bennadel.com)
-
Adobe Community Expert
-
Adobe Certified ColdFusion Developer
-
Co-Manager New York ColdFusion User Group
-
ColdFusion, XHTML, CSS, jQuery Developer
-
Not Your Typical jQuery + ColdFusion Presentation
-
Single-page application architecture
-
ColdFusion as a webservice
-
Javascript MVC architecture
-
jQuery as the core framework
-
What jQuery Conference 2009 Taught Me
-
I don't know nearly enough!
-
Applications are getting much more rich
-
Best server-side practices are moving to the client
-
Not enough information on Javascript architecture
-
I'm Still Learning This Stuff
-
A lot of what you see here was designed for this presentation
-
Not here to show you "the way" - just new ideas
-
jQuery + ColdFusion = AwesomeContacts
-
ColdFusion / jQuery / JSON Database
-
View demo
-
Application Architecture (mostly)
-
Part I: jQuery
-
jQuery Overview
-
Index page is the application
-
Application.js is the framework (like Application.cfc)
-
Application monitors changes in URL hash (#/event)
-
ex. #/contacts/
-
ex. #/contacts/edit/123
-
Controllers map hash-changes to event handlers
-
Controllers can delegate control to Model or Views
-
jQuery Framework Architecture / Work Flow
-
Quick Aside: Self-Executing Function Block
-
Application.js Is An Object Factory
-
Manages class instantiation and singleton storage
-
Need to tell Application.js about your classes:
-
application.addController( instance );
-
application.addModel( instance | class );
-
application.addView( instance | class );
-
Can ask Application.js for classes and instances:
-
application.getModel( className [, [ arguments ] ] );
-
application.getView( className [, [ arguments ] ] );
-
Adding Controllers
-
Adding Models (and Views)
-
Code Demo
-
What Else Is Out There?
-
Sammy
-
JavascriptMVC
-
SproutCore
-
PureMVC (for Javascript)
-
TrimPath Junction
-
JamalMVC
-
Claypool
-
I Don't Have Your Server-Side Technology!
-
Want to play?
-
Don't have ColdFusion / Ruby / PHP / Python / etc?
-
Swap Model for "static" fun and testing (no server required)
-
contact_service.js --» contact_service_static.js
-
Part II: ColdFusion
-
ColdFusion Overview
-
Everything passes through Application.cfc
-
CFM + Remote CFC Requests
-
HTML + TEXT + WDDX + JSON + JSONP + SOAP
-
ColdFusion Request Architecture / Work Flow
-
Why OnCFCRequest()?
-
You can handle CFC requests in Application.cfc
-
ColdFusion 9 is adding this method to the application framework
-
Cache remote CFCs
-
Properly handle API errors
-
Return more data formats (JSONP, custom XML)
-
Code Demo
-
Thank You For Listening
-
Ben Nadel
-
Blog: http://www.bennadel.com
-
Email: ben@bennadel.com
-
Ask Ben: http://www.bennadel.com/ask-ben
-
Consulting: http://www.epicenterconsulting.com