Saturday, October 20, 2007

Using 4D Ajax Framework with jQuery

Lee Hinde gives talk on using jQuery at 4D SummitThese are notes from the "4D jQuery" session presented by Lee Hinde at 4D Summit 2007.

Javascript frameworks are there to make things easier. For example would you rather write

document.getElementById("item");

or

$("#item")

Frameworks have dealt with all the cross-platform issues, and the provide built-in DOM manipulation, visual effects and more.

He thinks some of the best Javascript frameworks are:
  • Dojo - has big name backers
  • Prototype - developed along with Ruby on Rails
  • YUI - Yahoo! interface set - they'll even host it for you (if you want)
  • Ext - beautiful user interface framework (does have developer license), was originally built on YUI, can also sit on top of jQuery
  • jQuery
jQuery was developed by John Resig while a student, now an evangelist at Mozilla. It uses CSS syntax. It has a large active community (which is tolerant of stupid questions) and is used by Digg, NBC, Amazon, BBC, etc.

For what he's presenting here he's only used two of the 4D Ajax Framework Javascript files - bridge and tools. His Javascript doesn't talk to 4D, it talks to the 4D Framework files which talk to 4D.

4D Ajax Framework wants dates formatted as YYYY-MM-DD.

Lee likes Firefox because of the features that are offered by two Firefox plugins: 1) Web Developer Plugin, and 2) FireBug - allows you to trace your Javascript code and reports back on communication from the server (indespensibe).

4DAF is very consistent in how they spit out data (very good thing).

It's important to put jQuery into no conflict mode so it's notation doesn't conflict with other frameworks you may be using. So instead of writing $("#name).val() which might conflict with say 4DAF, no conflict mode would have you write $j("#name).val() which won't conflict with other frameworks.

In Lee's app there's only one web page, all the divs for what the user thinks of as "pages" are on that page and he hides and shows them as needed to make that one page function as many pages.

His point in the whole discussion is that if you already have an established way of working (say you already work with jQuery or another framework), you can put 4DAF just for data retrieval and still use the framework you're accustomed to.

His other point is that you tend to be 'owned' by the framework you choose to work with. If you're not comfortable with the 4DAF, you don't have to go whole hog with it to the point that you're bound to whatever 4D gives you - just use the bridge plus whatever you feel comfortable with.

Labels: , , , ,

Digg It!  Add to del.icio.us  Add to StumbleUpon  Add to Reddit  Add to Technorati  Add to Furl  Add to Netscape

1 Comments:

Lee H said...

Jay, this is a great summary. Thanks for doing it.

In case anyone wants to reach me with questions about the presentation, I'm at lee at hinde dot net.

Thanks.

Sunday, October 21, 2007 1:20:00 AM EDT  

Post a Comment

Links to this post:

Create a Link

<< Home