Return to: The
Learning Curve Journals»
During my exploration of the Java Studio Creator IDE, I have found that one thing that impresses a lot is that it helps me begin programming with new technologies fast. With drag and drop placement — and some minor coding — I can quickly become proficient in technologies such as Web services, Ajax, XML and more. This journal entry is a description of my first explorations of Ajax technology using the sample Ajax components included with Java Studio Creator. In my last entry, I explored using and configuring components, and I built a simple application based on the Calendar component. In this entry, I will take it one step further and import a set of Ajax components. With just a few keystrokes, I'll deploy my own edition of Google Maps, showing how easily this can be done with both components and Ajax technology. Contents
Ajax is one of those technologies that — when you first see it in operation — opens your eyes to many new possibilities. It did so for me. It expands on the usually HTTP-request dialog that goes on with Web browsing, and adds a new level of dynamic momentum to Websites. Google offers several great examples of it in operation. One such site is Google Suggest. Notice as you start entering characters in the Google search box, suggestions are being fed back to you as you type. This is Ajax in operation; data is being exchanged (via XML) asynchronously between you and the Google Web server through a particular object, XMLHttpRequest. It is a powerful technology because the whole page does not need to be reloaded every time data changes, and only the data you require is being transferred. Besides typing letters, other kinds of events can trigger the exchange of data, such as mouse clicks, a document being loaded, or change of focus, etc. A great article on SDN that introduces Ajax, and also demonstrates how to build a similar application with a dictionary Web service that is included as apart of the Sun Java Studio Creator, is titled Using an Ajax Text Completion Component. Find this, and other articles and tutorials on AJAX, here. As I mentioned in the last article, components are a powerful part of the Java Studio Creator IDE. I got to see their power by using and configuring the Calendar components in my last journal entry. Now I'll leverage the ability to import components and install a set of prefabricated Ajax components that lets me do some very neat things. I'll focus the remainder of this discussion on just one of the BluePrints Sample Ajax Components which comes with Creator. I'll need to visit the Update Center to download and install these components (I'll discuss more about the Update Center below). Sun has produced a set of reference applications (that include use of these Ajax components) that demonstrate best practice programming across all of their development tools: NetBeans, Java Studio Enterprise, Sun Studio, and Java Studio Creator. These can be very detailed, such as the Adventure Builder reference application that demonstrates a wide spectrum of J2EE technology. The Web component of Adventure Builder was also ported to Java Studio Creator, to demonstrate how one would go about producing the same application using the IDE. This article is called Using Adventure Builder as a Guide to Building a Web Application in the Java Studio Creator IDE. These reference applications and components are what Sun calls BluePrints. You may see them referenced often as you explore the SDN. Here are the BluePrints Sample Ajax components that are available through the Creator Update Center:
Installing the Ajax components requires that I go through the process of updating the IDE through the Update Center off of the Tools menu, and then import the components with the Component Library Manager. See the SDN article: Downloading and Importing the Ajax Components Into the IDE for detailed instructions on installing the Ajax components. It's a good idea to connect to the Update Center often so you can get new samples, fixes, and other updates, automatically. More information, including instructions on using the Update Center is available here.
The Component Library Manager is great to explore. It allows me to import the components I downloaded, and choose which components appear on the Palette. Once the Ajax components are imported (I followed the instructions in the article I reference above), they appear under the BluePrints (Ajax) Components node. This is also the name of the folder that they are listed under in my palette. To access the Component Manager, I right click on one of the headings (such as Standard) in the Palette and choose Manage Component Libraries. Or I can select Component Library Manager off of the Tools menu.
Notice in the Component Library manage — in the left column — that components have both a "design time" and a "run time" jar associated with them. The .jar includes all the classes that make up the component, and it defines the behavior each component exhibits at both design time and at run time. This means that, as I design with components, the behavior the components exhibit on the Visual Editor is defined here. Then once deployed, the components will demonstrate "run time" behavior as defined in a separate set of jar's (or all behavior may be included in the same jar, but still separate classes). Configuring and Deploying the Google Map Viewer
After importing the Ajax components, I now have a new component category in my Palette window: BluePrints Ajax Components. I will use the Map Viewer component to configure the Google Map viewer. Building the Google Map Viewer application is very simple. You can follow along as I build the application: Obtain a License Key from Google Conclusion
Producing applications with Ajax components has been a lot of fun, and it has very much opened my eyes to new possibilities. There is nothing like the feel of programming with the power of a component that does a tremendous amount of functionality — especially when that functionality was not available to me before. I've struggled over many pre-Ajax hours to try to get a "progress bar" working — for example, to keep my clients from refreshing a page, or closing a perfectly good session for fear that it crashed. Plus, I never could get it working right to begin with, given the limitations of trying this through HTTP requests. So here comes Ajax to the rescue, and Java Studio Creator has succeeded in bringing me right into the core of this technology with minimal effort. What I really like is that I've been able to quickly build these Ajax applications, without needing to know a whole lot about the specifics in this technology. Yet nothing prevents me from looking behind the scenes, so once I've got my application going, I can look more deeply into what makes it tick. Not a bad way to learn! Next Time: Consuming Web Services with Java Studio Creator
In the next installment of the Learning Curve journals, I will explore another exciting technology, Web services, and build an application that consumes Web services. More Developer Resources
|
| |||||||||||||||||||||
|
| ||||||||||||