Rob Gonda's Blog

Ajax Intensive: 33%

We're still three month away from CFUnited, and there're only 20 spots left in my Ajax intensive class. The class is limited to 30 seats, which have never been sold out to-date, but IMO they will this time; and soon! If you are attending CFUnited, you must come in a day early and attend this class. Reserve your seat now before it's too late.
By the way, if you have any doubt of the material, please do not hesitate to drop me an email. I will also be giving a brief preview at CFLive, using Breeze next month. More details to be posted soon.

Slides for the SEOMUG Spring Conference

I just got back from dinning with Jeremy Geelan, a really nice guy I must insist. He gave a keynote at the conference, and I had two sessions. We had about 300 delegates, not bad at all. It was indeed the best conference and value ever for the $25 cover fee ;)

My first session was ajax101, a kickstart providing you all basic information on AJAX. The second, was an ajax301 (yes, I skept one) providing a higher level AJAX solution, using ColdFusion, Model Glue, AjaxCFC, and optionally XML Sockets. For this second session, I showed how to develop Ajax application without coding a single line of JavaScript (for some basic examples). Furthermore, you could reuse 100% of your traditional html application, including models, controllers, and even the views.

You can download the slides I used for the sessions, and I'll compile the examples I used soon too. Most of the examples are available though my ajaxCFC download, including all the Model Glue examples, sockets, etc ... except the Model Glue framework itself. I should make a copy available anyways, because I use a BER (head version on an svn server) version for all my examples.

I mentioned in my sessions that I will do my best to answer all questions and emails, and I keep my word. Please comment here or if it's too lengthy, just drop me an email.

I hope you enjoyed the sessions as much as I did.

p.s. more on other sessions and pictures to be posted soon.

Download slides for ajax101 and ajax301.

BlueDragon's smart move

Here's one for you ... is .NET 2.0 better than ColdFusion? I wouldn't say better... but they did just release their Atlas tools for Ajax development... I haven't seen those yet... the server has to run Microsoft Windows, with .NET 2.0, and all that good stuff ... so it's restricted on the server side, but as long as they make the client side compatible with all browsers and platforms they should be o.k... there are so many toolkits out there that only work with IE, or don't want to work with Safari or Opera browsers.

I digress. BlueDragon announced that Atlas will be compatible with BlueDragon.net, which should be an interesting combination...

Google does it again: Flash and Ajax happy together

so who said it's Ajax OR Flash? It's been proven lately that they can co-exist and benefit from each other ... Flex released the Flex-Ajax-Bridge, Rob released Apocalypse :) Ajax and XML sockets, and now Google demonstrate to the world how it should be done.

Check out:
http://finance.google.com/finance?q=adbe

It's a really nice mash-up of technologies and data, put together wish Ajax calls combined with Flash to make a unique user experience. I have a feeling that if Yahoo doesn't get up to speed soon Google will make all their products obsolete.

Go jo!

Behold Model-Glue users! MG+AJAX Made easy

I just released a new improved version of ajaxCFC for the Model Glue framework. Now it's even easier to add Ajax to your robust ColdFusion MVC applications. I modified the Echo Example and added a Contact Manager Example to show how it works. All open source and included in the ajaxCFC download. The contact manager example is the same that comes with Model-Glue, using the same controller, models, and views ... slighly Ajaxified :)

[Updated] IMPORTANT NOTE: The XML Socket works on port 1225, so if you're behind some firewall preventing that traffic you will not see the refreshes. I am still working on some port 80 proxy, but for this experiment just open that port.

btw, I will be demonstrating all this at the upcoming Spring Conference, this week.

If that wasn't enough, included is also the next level of Web 2.0 applications; a mash-up of ColdFusion / Model Glue / ajaxCFC / XML Binary Sockets / CF Event Gateways... This combinations allows you to only for your presentation layer to interact with the server in the background, but also for the server to push data to the clients. No more Ajax pulls every 3 seconds interval, now the server can just broadcast the command to all clients. I shall call it Apocalypse. ;)

I modified the Contact Manager example that comes with model glue to use Ajax and Socket servers... now every time anyone adds/edits/deletes a contact all clients' views will get updates... just imagine the possibilities. Just try it yourself... open two browsers and see them interact.

I will try to briefly explain the framework the best I can.

First, you need the BER version of the model glue framework; Joe still hasn't officially released MG v1.1.

Now, the framework consists of a model: ajax.cfc, some JavaScripts included in the views/js folder, and a rendering view ajaxResponse.cfm. That's it...

How do it work...
The examples that come with Model-Glue use a private Layout hanlder, so I just added two more: AjaxLayout and SocketLayout... Now every time you need to respond an Ajax request you use the AjaxLayout, and if you want to broadcast something through the socket, you use the SocketLayout.

I modified the controllers init and OnRequestStart to parse the Ajax request... once it gets to your controllers handler all Ajax vars will be sent to you as regular event values, which you can get with getValue. There's not much more you need to know there...

Your controller will do its thing and set vars to be used in modelglue.xml ... now, here's the beauty ... when you use the AjaxResponse renderer your views will modify DIV Layers, or anything with the view's ID ... For example, if your body has a container calls contentForm, once you render a view with that name, all content will get placed inside that DIV...

If you need to run scripts you can use a reserved view name: 'script'. If you create a view with that name, all code inside that view will get evaluated in the client side. I modified the Echo Example to use this method so you can see what I mean.

The socket implementation is still in alpha mode... I just finished the prototype today... how does it work?!

I added a 1px Flash movie that weights only 1k that all it does is to open a socket connection to a ColdFusion Event Gateway. I rewrote the XML Binary sockets that comes with CFMX7 to better suite the Flash XML Socket protocol. I also added a few methods such as onConnect and onDisconnect. Anyways, when you need to talk to the server to do it through Ajax, but if the server needs to talk to you, it will do it through the XML Gateway. The beauty is that you do not need to modify anything or create any custom handler for it ... The flash movie uses FS Command to communicate with JavaScript and triggers the same calls the Ajax response would, so the same rendering in the server works for either method.

I included the org.gonda.socket.jar file, which would have to be registered as a custom event gateway to make the contact manager example to work. Just point your JVM class path where the file is, restart ColdFusion, and register a new gateway:
Name: FlashSocket
Class: org.gonda.socket.SocketGateway

Then create a new instance and call it 'flashSocket1'. I provided the cfg file in the example too.

In the main view, both IP and port are passed to the Flash file as FlashParams... will easily see how to modify it.

I know, you are thinking it's too much, but it's not THAT complicated ... and it's well worth it ...

Ok, so what is the catch? There are a couple of issue I still need to work on ... one) The socket binds itself to an IP and port, and I don't want to create a new socket for every application.. especially if I need to open a new IP on my firewall every time ... two) firewall... yes, I need to find a way to perform http tunneling, or to detect that it was blocked on run time to shift all socket calls to Ajax.

I know it's not crystal clear, but I wanted to get it out there and get people thinking ... I'll try to document it better this week before the conference.

37signals launch Campfire today

37signals announced today that Campfire is official. Campfire is a group chat for business in the browser. I have to say, they did a great job. The chat is really complete: secure, it allows file sharing, live image previews, and when they claim the setup takes 10 seconds, it's true! I just setup a personal FREE account in less than that.

The 3-second polling technique worries me ... that's the one and only reason why chats should not be written with Ajax. It is way better than the 3-second meta refresh, but it's still harmful. Flash/Flex chats have far better performance, or combining Ajax and XML Sockets (which I will demonstrate this week at the Spring Conference) performs way better... of course, you need to deal with XML Sockets going thru firewalls... I'll post more on this shortly.

Web 2.0 on the desktop

NetJaxer is the first initiative I've seen to take Web 2.0 to the next level. It allows you to integrate your favorite Web 2.0 pages, such as gmail, writely, TadaList, Digg, etc... directly into your desktop. They use their own browser, which is fully Ajax compatible (so they say :).

Netjaxer is an easy way to integrate your favorite web apps into Windows. Create a desktop or quick launch icon. Load any web page when Windows starts and run it as a tray icon.


It will interesting to see what they come up with to make this more than a shortcut to a web site... mashups, gmail - tadalist with outlook could be one ...

Real-World Ajax NY Photos

For all those of you who attended the Real-World Ajax Seminar, I attached a zip file with 128 pictures... most likely you'll be able to find yourself.

Enjoy.

[04/02/06 - updated: added 11 pictures]

Web Prototyping Ajax support

For those of you who are organized and have time to prototype your web application before building it, I have great news. Software Solutions has announced the release of Axure RP Pro 4, the latest version of its popular web application prototyping tool. Axure RP Pro 4 is the first modeling tool on the market to allow easy prototyping of AJAX or other Rich Internet Applications (RIA). RIAs can deliver a much more interactive and engaging user experience and are quickly becoming the standard for next generation web applications.

iChameleon Group has been using Axure for a while to diagram site flow, user interation, and form fields before we start developing. After we build a full prototype we get the client's approval, and only then it goes into production. This has been great, but every time we needed Ajax calls we would write notes in the page without being able to represent it visually... the new release makes it a little easier.

Check out a full article on the new release here, or go directly to the official site for demos and more info.

First Real World Ajax Seminar Slides

If you are one of the 350 people who attended the Real World Ajax Seminar, one of the 15,000 who watched the simulcast, or you just happened to find the video-cast (which I'll link when sys-con publish it), you may find useful to download the slides I used.

Just a quick recap, I started my speech informing that I will not show any UI, I will not speak of frameworks, and I will not add any sales pitches; instead, I will go back to basics and talk about best practices and foundations for developing proper and successful Ajax applications. My high-level presentation applies for any Ajax project you might be working on and does not tie you into any framework or server side language.

An extract from the backbase's description of my presentation

He is providing a lot of best-practices, such as ‘provide the user with immediate feedback’, ‘design for errors’ and ‘keep state on the server’. He explains that this last point is one of the most important points for enterprise Ajax applications, because it introduces security risks: he then primarily refers to business logic. Rob then gives several security guidelines, where he emphasizes that Ajax pretty much works like regular HTML pages.

More Entries

This blog is running version 5.9.003. Contact Blog Owner