Quantcast

« CSS 2.0 - Descendant, Child, Attribute, Adjacent Sibling Selectors Join the LSD Beta »

AjaxCFC

AjaxCFC is an Ajax Framework for ColdFusion from Rob Gonda. Well, my reaction after going through it was AWESOME and huge thanks to it, lately have been able to finish up a small Messaging System integrated inside one of a Rich Internet Application, Live Speed Dating.

With AjaxCFC, a generic ColdFusion Component using the facade pattern was created which contains all the methods for the Messaging System. It made it so easy for me that I had to just take care of the functionality of a single method; DWREngine._execute() with the respective arguments. This is the method which handles passing of the data and also the method calls to ColdFusion. The arguments required are also quite simple and easy even for a newbie to understand.

Looking at the method signature of the function;

DWREngine._execute(_ajaxConfig.cfscriptLocation, null, ‘CFmethodName’, args, callBackFunction);

Though you can pass multiple arguments, my preference is to use a value object instead. Let us look at some points in respect to the particular Module of the RIA which I am currently working.

  1. The _ajaxConfig.cfscriptLocation is the actual path to the CFC which contains the methods I need to call for my mailing system.
  2. The second argument is the script name to be executed. This argument is null most of the times.
  3. The CFmethodName is the name of the method you want to call from the CFC.
  4. The fourth parameter to this function is the arguments you wish to pass to the CFmethod. You can pass more than one arguments or even a value object.
  5. The callBackFunction is the function in JavaScript in your CFM which will always take a single argument which is the return result you get from your CFC.

Well, the bottomline is that in order to use our CFC with the AjaxCFC framework, all I had to do was extend my CFC to the ajax.cfc which comes along with the framework.

Implementing AjaxCFC into my application, not only made things faster and easier for me but also enriched the end user experience for our module, the Messaging System. Thanks to Rob Gonda, now I am looking forward to incorporate AjaxCFC with the Model-Glue framework which I have used for Live Speed Dating.

Note:
The client side part of AjaxCFC was tackled by one of my colleague, Manaswinee. She will very soon be having an article on the same. Keep an eye on her article to get an insight on the callback functions and how the data is handled at the client side.

Comments

  1. Rob Gonda | January 17th, 2006 | 2:55 pm

    Great post! I’m glad to find people who find my work useful. I was going to check out your Speed Dating site, but you do know it is password protected, right?

    Keep up the good work.

    Cheers

    -Rob

  2. Brajeshwar | January 17th, 2006 | 2:57 pm

    Rob, sorry about the protection. We are about to go public beta with LSD very soon. Just waiting for our ISP to setup a mailing list for us so we can manage the feedbacks. Should be well up within this week.

  3. Rob Gonda | January 17th, 2006 | 3:05 pm

    All good. Keep me posted; An AJAX dating site sounds intriguing.

  4. C | January 17th, 2006 | 5:59 pm

    Did you know Rob’s “creation” is the same as CFAjax?

    He basically pulled a “Ray Horn” on DRW… think about it Robbie.

  5. Rob Gonda | January 17th, 2006 | 6:12 pm

    I disagree. I based ajaxCFC on Joe Walker’s DRW and give him full credit throughout the site and documentation. Both projects are open source licensed under Apache 2.

    Ray Horn on the other side deliberately stole an open source project, encrypted it, removed documentation, removed mentions to the original author, and sold it for profit. That goes against any open source community; so much that he had to take it off his site and deliver a public apology.

  6. John | January 18th, 2006 | 11:44 pm

    You know Ray has reached rock bottom when he start using his own name to try to offend people.

  7. Brajeshwar | January 30th, 2006 | 12:27 pm

    Online Live Speed Dating, a Flash Media Server Application

    This application have gone through many phases; from ActionScript 1.0 to Actionscript 2.0, FCS Clustering from Delphi to ColdFusion/Flash combo, MS SQL 2000 to MySQL to PostGreSQL, changes coupla developers’ hand. The Oinam Team is finally able t…

  8. Johnny | March 5th, 2006 | 8:03 pm

    For the fourth parameter, how do you pass a value object? Is that a JS object or a CF object? When I pass in a CF structure, I get errors. So I am looking for an alternative.

  9. Rob Gonda | April 27th, 2006 | 3:21 am

    Jonny, the execute call is a JavaScript function, which means it happens in the client site, ran in the browser. The fourth parameter can take JavaScript complex values, such as JS arrays, or objects. It will provide it to CF as a CF array or structure… whatever you return in your CF function, will be also serialized and provided back to the JS callback function as a simple or complex value.

  10. HelloWorld | April 28th, 2007 | 4:22 pm

    Peace people

    We love you

Post a comment