Summary
Ajax applications often communicate with server-side components for their data. In addition to data, an Ajax application can also retrieve JavaScript code from the server, dynamically extending its functionality. Jack Herrington's IBM DeveloperWorks article compares three transport options available to an Ajax client for both data and code.
Advertisement
Java applets may have been responsible for introducing the Java language to developers, but applets demonstrated another, possibly even more powerful side of Java: mobile code.
Mobile code is the ability to load code into a running virtual machine from a network location, and thereby to extend the capabilities of an application dynamically, at runtime. Java enables mobile code because the virtual machine's class loaders can load classes not only from the local disk, but also from any network location. Java RMI, and then Jini, fully realized Java's mobile code capability from a technical point of view.
While applets succeeded in piquing developer interest in the Java language, Java's mobile code potential is seldom put to good use. An often-cited reason is the relative lack of availability of Java VMs on clients, but a more plausible reason is that architecting with mobile code requires a way of thinking still not well-understood in the developer community.
Similar to applets or RMI clients, JavaScript interpreters also have the ability to load code dynamically from the network at runtime. Jack Herrington's recent IBM DeveloperWorks article, The Ajax Transport Method (free registration required),explains the three methods available to an Ajax application to download both data and code from the server. The article illustrates all three methods with code examples.
To what extent do you believe mobile JavaScript code will influence the design of Ajax applications?