Top
Past Meeting Archive Los Angeles ACM home page National ACM home page Click here for More Activities this month
Check out the Southern California Tech Calendar

~Announcement~

Regular Meeting of the
Los Angeles Chapter of ACM

Wednesday, June 7, 2006

"Using AJAX to Create Clean Web Applications"

Dr. Ray Toal
Professor, Loyola Marymount University

Some of you may ask; what is Ajax?

Well a quick look at Wikipedia ( www.wikipedia.org ) turned up 23 distinct topics that use Ajax. The bottom of the list yielded Ajax (programming). (Article URL = http://en.wikipedia.org/wiki/AJAX )

Following that link reveled the following definition:

"Asynchronous JavaScript And XML, or its acronym, Ajax (pronounced A-axe, as in Ajax Amsterdam), is a Web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire Web page does not have to be reloaded each time the user makes a change. This is meant to increase the Web page's interactivity, speed, and usability.

The Ajax technique uses a combination of

  • XHTML (or HTML), CSS, for marking up and styling information
  • The DOM accessed with a client-side scripting language, especially ECMAScript implementations such as JavaScript and JScript, to dynamically display and interact with the information presented
  • The XMLHttpRequest object to exchange data asynchronously with the web server. In some Ajax frameworks and in certain situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server.
  • XML is commonly used as the format for transferring data back from the server, although any format will work, including preformatted HTML, plain text, JSON and even EBML

Like DHTML, LAMP, or SPA, Ajax is not a technology in itself, but a term that refers to the use of a group of technologies together."

Dr. Toal will expand on this definition. He will show through example, how using all these techniques will help add functionality, flexibility, and style to a website. Question session follows if time permits.

Dr. Toal's current research interests are in programming languages, distributed computing, and Internet technologies. He has published in several diverse areas such as graphical user interfaces and object technologies and has spoken at numerous ACM and IEEE events including professional development seminars. He has taught a variety of courses at LMU continuously since 1986. He consults and does development at CitySearch where he co-architected the company's first generation cityguide and several internal thick-client and public facing web-based tools. He has held past positions in the local chapter including Treasurer, Vice Chair and Chair. He finds the whole idea of a *general interest* professional society very cool since the greatest thinkers and intellectuals of all time were not members of sharply focused SIGs.

The LA-ACM will also present awards to some dedicated individuals for their service to the Chapter and the community.
prepared by Paul Schmidt
 

~Summary~

LA ACM Chapter June Meeting,
held Wednesday, June 7, 2006

The presentation was "Ajax Programming," Dr. Ray Toal of Loyola Marymount University.

Dr. Toal started out by asking what Ajax is or means and only a few members of the audience indicated much knowledge. The talk is about why Ajax matters and how to do serious programming in JavaScript. It also covered distributed, remote, programming in general, because there are alternatives to Ajax. The talk is not about novice JavaScripting. It is also not about what he called "Stupid DHTML tricks" and is not about webservices and doesn’t give highly opinionated pro or con views on Ajax.

Ajax is a snappy term given (last year) to a collection of technologies that have been around since the previous century. Ajax stands for Asynchronous Java Script And XML. The XML (Extensible Markup Language) isn’t required, plain text and JSON (Java Script Object Notation) are often used instead, but Ajat and Ajaj sound stupid. Why Ajaxify? There are many web applications in which every action causes the entire page to refresh and this is very annoying. You can create rich client applications without the users installing the applications. The techniques are cross-browser, server technology-agnostic, require no plugins and mostly use open standards.

Dr. Toal went on to a series of on-line demonstrations found at:

Dr. Toal said there were two basic things behind the demos:

  1. The actual document object in the browser was being modified dynamically (those were not Flash movies, applets, or other plugins).
  2. The browser was making asynchronous requests and processing the server’s responses (again, without the full page refresh).

He then provided some html code and Ajax scripting to show how you could do this yourself. He presented the four defining principles of Ajax:

  • XHTML (or HTML), CSS, for marking up and styling information
  • The DOM accessed with a client-side scripting language, especially ECMAScript implementations such as JavaScript and JScript, to dynamically display and interact with the information presented
  • The XMLHttpRequest object to exchange data asynchronously with the web server. In some Ajax frameworks and in certain situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server.
  • XML is commonly used as the format for transferring data back from the server, although any format will work, including preformatted HTML, plain text, JSON and even EBML

He then provided some html code and Ajax scripting to show how you could do this yourself. He presented the four defining principles of Ajax:
(From David Crane and Eric Pascarello, Ajax in Action, Manning, 2006.)

  • The browser hosts an application, not content.
  • The server delivers data, not content.
  • User interaction can be fluid and continuous.
  • This is real coding and requires discipline.

Ajax programmers have to know:
      HTTP, at least the basics
      XML and XHTML
      The DOM
      CSS
      JavaScript, really, very well.

JavaScript is small, elegant, very expressive and is flexible and dynamic. It is closest to Lisp, nothing at all like Java. OO done with prototypes, not classes. It has been described as the "Worlds's most misunderstood programming language," and it is based on the ECMA-262 international standard.

He presented a JavaScript programming example and said that like all good scripting languages there is not much boilerplate, just start coding. He followed with some explanation about JavaScript. There are only six data types: undefined, null, Boolean, number, string and object that covers anything else. JavaScript objects don’t declare classes, just create objects and add properties on the fly. Arrays are just objects with properties that are integers. A function is just an object. Since a function is just an object it can have properties that are other objects, be a property of another object (in which case it is called a method), be passed as an argument to another function and be returned as a value from another function. Dr. Toal provided examples of all of these and many other things. He said that like many technologies, Ajax is easy to misuse. He referred to the original "Ajax Mistakes" blog post:     http://alexbosworth.backpackit.com/pub/67688

This contains a good list of things not to do with Ajax, but you should search for more "Ajax mistakes" on your own.

You probably should not rely on the JavaScript interpreter to optimize your code, so you might want to explicitly cache things. JavaScript memory leaks come from holding on to references too long. Cyclic references can be common in Ajax. DOM Inspector, modi, Venkman debugger, and Mochikit logging can help.

Alternatives to Ajax are Flash, IFRAMEs, Java Applets, Java WebStart, XUL, XAML and probably others. There is an article at: http://www.ajaxinfo.com/default~viewart~8.htm

Prof Toal ended with the following conclusions:

  • Decent Ajax apps require serious programming.
  • JavaScript has a lot of power and flexibility many people used to be unaware of.
  • There are lots of toolkits and frameworks out there.
  • Know some design patterns.
  • Be aware of common Ajax mistakes.
  • Know tools: DOM inspector or modi (beta), JS console, debuggers, etc.
  • Know some Ajax alternatives.

You can find the charts for this presentation at: http://www.technocage.com/~ray. Scroll down to "Some Presentations and Seminars."

(Microsoft Word may not have recognized all of the internet references as legitimate web commands, but this reporter tested all of them, including those that weren’t recognized)

Dr. Toal covered a lot of material in a very short time period. The information flowed freely and was easy to listen to. It was a detailed overview that assumed some background for a programmer who wants to add some new tools to his skills. Much of his commentary was explanation of what was happening during demonstrations and what the information on his charts meant in practice. It is difficult to do justice to his excellent presentation in a newsletter report. If you want more information on Ajax and were not at the meeting I suggest you review Dr. Toal’s charts and check the other on-line references. That will give you a start, but won’t be as good as attending the meeting.

This was another of the regularly scheduled meetings of the Los Angeles Chapter of ACM. LA ACM now takes its summer break and our next regular meeting will be held in September 2006. This was the ninth meeting of the LA Chapter year and was attended by about 19 persons.
Mike Walsh, LA ACM Secretary 
 

And coming in September. . . An Evening with Peter Coffee of eWeek. Details in late August.
Check Back in August!


This month's meeting will be held at Loyola Marymount University, University Hall, Room 1767 (Executive Dining Room), One LMU Dr., Los Angeles, CA 90045-2659 (310) 338-2700.

Directions to LMU & the Meeting Location:

The Schedule for this Meeting is

5:15 p.m.  Council Meeting

6:00 p.m.  Networking/Food

7:00 p.m.  Program

9:30 p.m.  Adjourn


No resevations are required for this meeting. You are welcome to join us for a no host dinner in Room 1767. Food can be bought in the Cafeteria. Look for the ACM Banner.

If you have any questions about the meeting, call Mike Walsh at (818)785-5056, or send email to Mike Walsh .

For membership information, contact Mike Walsh, (818)785-5056 or follow this link.

Other Affiliated groups

SIGAda   SIGCHI SIGGRAPH  SIGPLAN

LA SIGAda

Return to "More"

LA  SIGGRAPH

Please visit our website for meeting dates, and news of upcoming events.

For further details contact the SIGPHONE at (310) 288-1148 or at Los_Angeles_Chapter@siggraph.org, or www.siggraph.org/chapters/los_angeles

Return to "More"

Past Meeting Archive Los Angeles ACM home page National ACM home page Top

 Last revision: 2006 0726 [Webmaster]
 Page posted:   2006 09??