Rob Gonda's Blog

Speaking at our local South Florida CFUG

I will be speaking at the South Florida CFUG this coming February 23rd. Guess the topic, lol, Ajax indeed. I will be covering all Ajax101 basics. Overview of AJAX (Asynchronous JavaScript and XML) including ajaxCFC, CFajax, and JSON. I’ll talk about the history of Ajax, what it means to you, why you should pay attention, who is using it, what is available, and how to implement it. This session will get you up to speed with Ajax, compare the different existing frameworks, and provide you with helpful tips of do’s and don'ts.

If you’re local, I hope to see you there. BTW, iChameleon Group is hiring, so if you’re interested in a career boosting opportunity to work at the greatests CF projects of the year, stop by and drop your resume.

Going to CFUnited / pre-conference classes poll

I forgot to mention, I bought the conference pass to CFUnited last week! This is the first year I get to go; I've been trying for the longest time, but there is always something.

By the way, I will be teaching a pre-conference class: Intensive Ajax for ColdFusion Developers. I putting together my class material now, so it there is anything you wish to see, now is the time. (link to be posted soon)

I will also be participating at the Birds-of-Feather open discussions. I hope to see you guys there.

ColdFusion Position In Hollywood, Florida

iChameleon Group offers an incredible career building full-time position working with notable National + International companies. Our fast growing company develops various exciting, innovative, and high profile applications fusing media, video, audio and Flash.

We are a fun, eccentric, hardworking, creative group in a business casual environment.  We are looking for a dynamic, motivated team player who will enjoy working in a fast-paced, deadline driven, ever changing development and solution-based environment.

The successful coldfusion web developer candidate must posses:

  • The ability to support for the full application development life cycle activities of software products and development.
  • Demonstrated skills in documenting development.
  • Strong problem solving and debugging skills.

Requirements, skills + abilities:

  • Team Player
  • Self Starter
  • Interactive site development experience
  • 2-5 years of experience                         
  • ColdFusion MX 7
  • Object Oriented Programming    
  • Experience with Flash Remoting
  • Database design and SQL
  • HTML, JavaScript, and CSS
  • PC fluent (Mac A Plus)
  • Solid communications skills (written and verbal)
  • Outgoing, Energetic Personality 
  • Good Organizational Skills
  • Detail oriented, strong follow-up skills and ability to work on multiple projects
Additional skills:

  • Macromedia Certified ColdFusion MX 7
  • Framework Knowledge (Fusebox, Mach II, Model-Glue, Tartan)
  • Design Patterns
  • UML
  • AJAX 
  • ASP, PHP, PERL, or any other web language 
  • CVS and/or subversion experience

Want to come join our team? Submit your resume and cover letter, including salary history, to jobs[at]ichameleongroup[dot]com

Know your ColdFusion Server: ajax monitoring

Steve Brownlee put together a basic application that you can run to provide you with realtime graphs and charts displaying your JVM memory usage using AJAX, thus no page refresh. You have the choice of the following views.

1.    Total JVM
2.    Eden Space
3.    Survivor Space
4.    Tenured Gen
5.    Permanent Gen
6.    All memory spaces

In each view, you can choose to have the charts update every 2.5, 5, 15, 30 or 60 seconds. Having shorter intervals is great for when you are actively watching the memory to identify problems or monitor your usage, and then switch to long intervals for historical charts.

It's still in its first stages, but it’s free, growing, and has a huge potential to become a must-have tool for every ColdFusion Administrator. If Steve could add active threads, queues, cpu time, and keep expanding, I'll be running this tool 24/7.

check out the Orbwave Memory Explorer 0.1.103.

ajaxCFC for Model-Glue Explained

While this is not the final documentation, I know some people are starting to play with ajaxCFC/MG and my implementation is not straightforward. This is my first draft to get the feeling on how to document it.

Ajax.cfc is just another model in your MG application, used by the controller to manipulate data. You can initialize it in your Controller’s init function and store in persistently in the controller’s variables scope.

The Ajax remote request call flows exactly (or almost) like a traditional call. It flows as follow:

  1. Page triggers an AJAX request.
  2. The event will be caught by the MG framework.
  3. The MG event-handler will broadcast a message.
  4. The controller will pickup the message.
  5. The controller will AJAX model to parse it (onRequestStart)
  6. The controller can use other models at will (theEvent)
  7. The controller uses the AJAX model to prepare the reponse.
  8. The controller sets the ‘ajaxResponse’ value back to be used by the view
  9. The modelGlue.xml includes ajaxResponse.cfm as the view that will transmit the response back to the JavaScript callback function.

Alright, so this may sound complicated, but it really isn’t. The flow is exactly like any other page with the exception of:

  1. You need to parse the Ajax request with the Ajax model.
    1. You will received a structure with two elements

                                                              i.      id: the unique identifier of the Ajax remote call request

                                                            ii.      params[type array]: this includes all arguments passed by the JavaScript function. Because the arguments are unnamed, you will receive them in an array in the same order that they were passed.

    1. My example parses the values in the controller’s onRequestStart and place them in the request scope to be picked up later by the requested method.
    2. Optionally, you may invoke security and debugging functions contained in the Ajax model.
  1. You need to prepare the response before sending it back to the framework. You will use the Ajax.returnAjax method to do so. The returnAjax method always takes your response and the Ajax call unique identifier.
  2. You need to set the ajaxResponse value to be used by the view.
  3. Finally, include the ajaxResponse.cfm file that simply displays the ajaxResponse value sent by the controller.

Your JavaScript callback function will receive any response you sent as an argument.

That is pretty much the basis; nothing fancy, nothing different than what you usually do with the MG framework. Ajax.cfc is just facilitating the seamless communication between your JavaScript and ColdFusion side; that is all.

Note that the main event (the one making the Ajax call) needs to include the ajax.js file, the _ajaxConfig JavaScript object, and of course, your JavaScript calls and callback functions.

While I do not recommend leaving business logic at the client side, because it defeats the entire MVC and thus MG framework, it is the easiest way to get started with Ajax.

In my next example, I will show how to leave all the business logic in the server side, contained in views, and leave only connectivity functions in the client side.

If you have any comments / requests, do not hesitate to comment or contact me and I will do my best to add them to the framework.

ajaxCFC update for DRWUtil.AddRows

A recent message in the ajaxCFC group asked about the DRWUtil.addRows() function; the truth is that I had never used it. I include the utils library because there are other elements that I find useful, but I had never given the addRows a try.

Enough said, since I include the file, I guess I need to support the built-in functionality, but the addRows out-of-the-box was accepting arrays and objects. I serialize the ColdFusion queries into a more complex object which was not recognized by the addRows function, so I modified it to add wddx support. When you pass a wddx object to addRows it will now automatically populate your table, even without the need to cell functions (like the array or object methods).

You can find an example here, and download the latest release (0.63) with the code changes, example, and updated documentation from the projects page.

I'd like to thank again Joe Walker for his great effort in putting DRW together, and I will email him the changes to add wddx support for his next release.

ajaxCFC port for the Model-Glue Framework

The latest fad in the Model-Glue list has been AJAX. How to incorporate Ajax requests to the Model-Glue framework. Is it pointing directly to the model? To the controller? or going thru the full cycle by pointing to index, then controller, model, back to the controller, and passing arguments back to the view?

I ported ajaxCFC to work with Model-Glue and it came out great. It works just like any other MG event, where you have to define it in the config.xml, create a listener, use the controller, models, and views... it's beautiful. All ajaxCFC's add-ons like security and debugging work file. Request batch, complex objects, verbs, and sync requests possibilities still apply.

You can see it in action here. To make this example work you need to download the head revision from the Model-Glue framework. The only reason why the stable release would not work is that you cannot suppress debugging in a template-per-template basis.

I added the MG-echo example in the main ajaxCFC download, which also includes a modified version of ajax.cfc and engine.js. I will try to combine the stand-alone version with the MG one in the future, but for now, I will support both of them separately.

Enjoy.

ajaxCFC: addressing html code in application.cfc

I just got hit with an email informing me that ajaxCFC will break when application.cfc adds code onRequest(start|end). I modified the framework to reset the content before the JavaScript response, and abort it at the end of the asynchronous call. I am not quite happy with the abort though, so if someone has a better solution to eliminate all code generated by onRequestEnd please comment it here. I tried to open a JS comment segment, but then it results on unfinished comment; setting enable cfoutput only will only work if the code in application doesn't use cfoutput; cfsilent needs an ending tag.

The abort works for most of the cases; the AJAX request will always work, but if you had some custom code in your onRequestEnd, such as logging, it will not be executed.

Note on application.cfc: as a general rule, try to avoid using application.cfm/cfc for html rendering. It is advisable to separate your logic from the presentation layer. Application.cfc, just like any other component, is encapsulated and parameterized, and should not display html. If you successfully separate your logic from your views, you will be able to use the same architecture for presentation layers such as html, ajax, flash, flex, laslo, or mobile devices.

Adobe vs. Microsoft: death match for RIA leadership

The buzzwords du jour are AJAX, RIA, Web 2.0 ... Both Adobe and Microsoft are involved and trying their best to get market share. Abode has Flash and Flex; and AJAX is compatible with every programming language and plays really well with CF (through ajaxCFC :) ).

Microsoft has been working on Windows Presentation Foundation (WPF), previously called Avalon. This presentation layer takes an xml based declarative language called XAML (pronounced zammel), that stands for eXtensible Application Markup Language.

I knew about XAML, but the interesting part is that Microsoft went big! They are also releasing a full development application set called expression. The community technology preview just came out and it looks like a take on Abobe's Creative Suite.

I suspect what unlike XUL (pronounced zul), which is Mozilla's xml declarative language, XAML will penetrate the market thanks to Microsoft's big name. It should natively work with the .NET framework and we should soon also see a version for Mac, even though Microsoft will no longer support their IE for Macs.

If you are a new developer and want to be ahead of the game, keep an eye on Flex 2.0 and XAML. There are other technologies such as laslo, xul, ror, bindows, backspace, and dojo, that should not be overlooked either.

IT Trends for 2006

  1. RIA (Rich Internet Applications) growth: We will start seeing more and more sites using AJAX, XAML, and Flex 2.0. With the release of XAML and Windows Vista, .NET Ajax sites will start becoming more popular. Adobe's (formally Macromedia) Flex 2.0 builder will allow non-flash savvy programmers to build full Flash RIA’s using nothing but declarative XML syntax. XUL will slowly fade away. RoR will attract php programmers, but will not find its way to the Java, .Net, or CF community.
  1. AJAX Platforms IDE’s will arise, making building user interface components with back-end integration through AJAX achievable without having to program with core frameworks. This new software will do for AJAX exactly what Flex 2.0 is doing for flash: allowing visual authoring capabilities by using new IDE’s, or by building plug-ins for existing IDE’s such as Eclipse.
  1. With quick growth of SOA, Web Services, and Remote Calls, data security will start becoming an issue. A greater effort will be devoted towards encryption, authentication, and authorization.
  1. Blogging will continue to rise, but as it does, a new, smarter filtering mechanism will have to be developed. Corporate IQ cannot depend strictly on tagging and aggregators. Probability based algorithms will analyze the personal relevance of every post.
  1. Mobile applications will start getting popular. AJAX for mobiles and Flash Lite will start hiring to build full mobile RIA’s.
  1. Some 25-year-old kid will become millionaire after coming up with a way for search engines to RELIABLY index AJAX and Flash applications.
  1. By the end of the year, Wi-Max will start becoming available in mayor cities, threatening ISP’s and cellular phone providers. VoIP wireless devices will slowly replace cell phones, providing more reliable, less expensive, and more sophisticated capabilities. Blackberries will loose market share.
  1. VoIP, IMS, SIP, XMPP, and SOA will continue to grow. Web 2.0 and VoIP 2.0 will merge. Unified messaging will get more popular among corporations.
  1. People will continue paying premium for self-service and software applications will loose market share to shared services.

More Entries

This blog is running version 5.9.003. Contact Blog Owner