Slashdot Mirror


Better Web Apps With Ajax

An anonymous reader wrote to mention an article on IBM's site detailing the fundamentals of Java-based Ajax. From the article: "This article gives you a good understanding of the fundamental principles of Ajax, and a nuts-and-bolts knowledge of the client and server side components that participate in an Ajax interaction. These are the building blocks of a Java-based Ajax Web application. In addition, you will be shown some of the high-level design issues that come with the Ajax approach."

16 of 184 comments (clear)

  1. With AJAX, you know you've got by knightinshiningarmor · · Score: 3, Funny

    Cleaner code than the rest!

    1. Re:With AJAX, you know you've got by temojen · · Score: 5, Funny

      Here's a screenshot:












  2. Two camps by sexyrexy · · Score: 4, Insightful

    I'm glad to see another serious technical article on the pros and cons of implementing an AJAX solution. Most everyone who says the acronym "AJAX" usually falls into one of two camps - either the "OMFGZ teh AJAX is so amazing! It will change the interweb!" How? Oh, it allows parts of the page to be updated without a refresh. How interesting. Perhaps you could go a little more in-depth? No? Thanks...

    The other camp... too many Slashdotters, IMO... feel the need to flex their superior understanding of the fundamental dynamics of the internet and development and offer this gem: "AJAX is just an assortment of pre-existing technologies. Nothing to see here".

    The automobile was just an assortment of pre-existing technologies, and it radically changed the world. It also introduced a whole bevy of new challenges, both technical and otherwise, that we still haven't fully figured out yet. It was not a transportation panacea, and AJAX is no cure-all. But just because it doesn't solve every problem doesn't mean it doesn't have the power to be revolutionary.

    --

    Rex is 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    1. Re:Two camps by museumpeace · · Score: 4, Informative

      It is not so much the technology as the economic might of the one of the biggest developers of AJAX: Google. They are giving a wall to wall 24x7 demo of AJAX technique and its effectiveness to anyone who pays attention. The fact that middleweight clients that can support a bit of asynchronous update traffic in what , to the user, is the "background", is not so much technically amazing as perceptably practical and a better web experiance. I was looking for better doc on AJAX, having first got the impression it had to be JavaScript [which, frankly, is a crappy tool for designing ambitious software]. This article is a good addition to a topic that doesn't have much presence in the bookstores yet. There are other sources on line. Its not just for XML and its not just a J language either... Ruby will do.

      --
      SLASHDOT: news for people who can't concentrate on work or have no life at all and got tired of yelling back at the TV.
  3. Atlas by ThinkFr33ly · · Score: 5, Informative

    Atlas is Microsoft's entry into the suddenly-popular-even-though-it-has-been-around-fo r-7-or-more-years AJAX trend.

    Atlas is a set of extensions to ASP.NET 2.0 that allows for web developers to use AJAX with little or no plumbing work on their part.

    It integrates with ASP.NET extremely well and maintains the "event driven" style that ASP.NET is known for.

    There is also a Channel 9 video about what Microsoft is doing on the AJAX front elsewhere.

    1. Re:Atlas by ThinkFr33ly · · Score: 3, Interesting

      So we shouldn't separate presentation from code because it makes it less portable? Actually, it often makes it MORE portable. My mobile web application is a great example. I was able to reuse a huge amount of code and target a VERY different client thanks to the fact my presentation and my code were extremely well separated.

      As far as portability in general... think about this. What would happen if you had to port one of your apps to Gameboy? What would YOU do!? What about my TI-86? Huh?

      Since I'm a developer who knows what they're doing, I know my target platforms before I start the project. If there is a chance I might need to port this to another platform in the future, then I take that in to account before I start the project.

      Crippling your application, or dramatically increasing development time, or being forced to choose a less than ideal development platform, because you want to make sure you can run it on another platform regardless of the business requirements right now is a bad idea.

      Sorry, but that VAST MAJORITY of web application will be created for one platform and stay on that platform for the foreseeable future. Applications that do require portability typically start off with that requirement from the get go. This is especially true for server side applications. (Which makes it all the more ironic that Java is so popular on the server side.)

      Nonetheless, there is Mono. They have made great progress. Is it perfect? Of course not. But neither is Java's portability.

      Lastly, you seem to view .NET developers as some kind of less educated developer. I'm not sure why. To some extent, I could see that with VB developers. They often started off with an MIS or IT background and had to use VB to solve simple problems. In fact, VB is great for that. VB evolved into a language that was great for a lot of things. But the stigma stuck around... with some justification. .NET developers live in a world that is far more advanced in nearly everyway than VB. We have all the great runtime features that the rest of the developer word has. I can write my .NET in C++, or one of several hundred other languages that can target the CLR. What, exactly, makes a .NET developer any less of a developer than somebody who chooses to toil away in PERL or Python or Java?

  4. When you're using java, you can... by fireboy1919 · · Score: 3, Informative

    ...use JSON-RPC instead. XML is longer and hard for a javascript interpreter to interpret. Why does everyone want to use it as a wire protocol? I've never understood this. It makes a lot more sense to me to just store everything as a javascript hash.

    Anyway, unlike the almost most ajax libraries, which are at this point almost totally devoid of docs, the guy who wrote a JSON-RPC library actually tells you how to use it. If you've got java, its the way to go, I think. Here it is.

    Personally, I'm a perl monger, so I use this lib, which isn't nearly as good, as you have to do most of the javascript stuff yourself. Faster than XML though, and its still rather trivial to turn a DOM object into a plain javascript one for use with JSON.

    --
    Mod me down and I will become more powerful than you can possibly imagine!
  5. The problem with AJAX is the X by MarkEst1973 · · Score: 5, Interesting
    JSON is a much better mechanism for handling data transmission in AJAX applications.

    Why? Less verbose (easier on bandwidth) and no parsing (ever tried parsing XML using XmlHttpRequest? It sucks). JSON is object syntax. It is a real, live object serialized to string.

    It just so happens that JSON is also legal Python object notation.

    Hmmm... GMail, Google Maps, Google Suggest... none of these use XML. Google is also renowned for using Python. JSON syntax is the same in client-side javascript and server-side python... hmmm... makes me think twice, anyway, instead of drinking the web services kool-aid Sun and Microsoft are serving.

    1. Re:The problem with AJAX is the X by spid · · Score: 3, Insightful

      Not so. In both IE and Mozilla XML parsing is done in native code, and is pretty darn fast. Granted, accessing the nodes in that resultant document can be tedious from a development standpoint, but if it's performance you care about, then XML will most certainly be faster. While JSON may be more terse, and easier to deal with as a developer, the browser still ends up having to create a lot of objects in interpreted code, which is a lot slower.

  6. Ajax library for Java by strokerace · · Score: 3, Interesting

    There's a pretty good library I've used recently called DWR.

    If you're looking for a Java library to do some of the heavy lifting, check it out.

  7. For examples... by bad_outlook · · Score: 3, Informative

    Check out the new cal for Hula http://hula-project.org/Hula_Server - amazing work.

    And the front end to the webmail for Zimbra http://www.zimbra.com/

    Really, really nice stuff.

  8. AJAX can be fun! by Klowner · · Score: 3, Interesting

    I made a little window-manager-esque thing in Javascript/CSS/HTML a few weeks ago (Looks messed up in IE, works fine in Firefox)

    http://dugnet.com/klown/ajwm/, all that's needed are some AJAX functions to swap out the contents of each window, instant freakish web-app thing..

  9. Re:XML is bloated by KagatoLNX · · Score: 4, Informative

    First, Unicode under JSON is abit exciting. In XML there are no surprises.

    Secondly, XML is transported over HTTP 90% of the time.

    Almost all modern HTTP implementations implement GZIP as an encoding. If you don't already have this enabled in your servers, then you don't really care about bandwidth utilization.

    JSON offers nothing useful over XML+GZIP (which is a transport/encoding issue anyway). It can, however, make it vastly more difficult to interchange your data and tie you to a limited object model. If anything, I support the process used by the W3C. I like their standards. JSON is nice, but not nice enough. Sorry guys.

    Learn XML. Learn XPATH. Try to use Twisted's XMLSTREAM implementation for a taste of how easy and flexible it can be. Write some Jabber apps. JSON can't really be in those spaces. Not anytime soon at least.

    --
    I think Mauve has the most RAM. --PHB (Dilbert Comic)
  10. JWP has a great AjaxTags component by fzammett · · Score: 3, Interesting

    Since everyone else is mentioning their favorite AJAX toolkit, I'll list one too:

    http://javawebparts.sourceforge.net/javadocs/index .html

    This is a component of the larger Java Web Parts project called AjaxTags. It's a taglib that allows you to easily add AJAX functionality to arbitrary page elements in a purely declarative manner, i.e., *NO* coding on your part (although there is more capability there if you need more). It really makes AJAX a breeze, and is pretty powerful at the same time. If you are a Java web developer, have a look, you may very much like what you see!

    P.S., The parent projects' page is here:

    http://javawebparts.sourceforge.net/

    --
    If a pion (n-) collides with a proton in the woods & noone is there to hear it, does lamdba decay into the source pa
  11. Re:AJAX for PHP Developers by doon · · Score: 3, Informative

    Cpaint

    I am using it now. seems to be working very well. has a Javascript library and both PHP and ASP backends. Can't talk to how the ASP side works, but the php side is very simple/straightforward.

    --
    To E-mail me, replace the first period in my domain with an @
  12. The Three Conditions of AJAX by Kamiza+Ikioi · · Score: 4, Informative

    "Its not just for XML and its not just a J language either... Ruby will do."

    No, XML isn't really a requirement of functionality. If by J you mean a Java backend, you are correct, but not if you mean Javascript Without Javascript you cannot have AJAX-like functionality unless you use a plugin or browser addon like JRE, Flash, etc.

    I just wanted to clarify this point to those who might take that statement the wrong way. Coding something in C++ that talks to a server is not AJAX, for instance. AJAX, imho, is defined by 3 characteristics.

    1. AJAX involves dynamic content, not static content. This means that there is a seemless interaction, without the application appearing to "reload".

    2. AJAX involves a stand alone web browser or an embeded web browser that is running the common scripting language Javascript.

    3. AJAX involves data retrival from a source outside of the client-side application itself, and does not solely use data embedded in the application itself.

    I could refine those a bit, but I think the general ideas come across. So, really, a Java applet embeded in your browser that talks to the server, such as an IRC chat client, is not AJAX, though it may provide AJAX-like functionality. The language of the backend is irrelevant; the data formats are irrelevant. The only relevance, really, is that you are taking something that has generally been static (web pages) and made the operate like a fully functioning application. It's the transition from "Information" (HTML) to "Application" (AJAX).

    The definition really can't go beyond this. If it isn't limitted to seemless dynamic content, you could call any webpage that contained Javascript AJAX. If it isn't limitted to browsers and Javascript, then you could call an SSH program, chat applet, multiplayer game XBOX game, etc. "AJAX clients". If it isn't limitted to outside data, then you'd have to call Javascript clocks AJAX. An application must (at least) satisfy these three conditions before it can be called AJAX. If it doesn't, it may still be a really good interactive and dynamic application, though not AJAX.

    The core of AJAX, XMLHttpRequest, is the only place I think the term XML is validated in the AJAX acronym. And, certainly, you can load any type of data you wish with it. If there was any single thing to define AJAX, it is this command. Without it (or something like it coded in a round about way... who knows, some people like the challenge) you cannot satisfy all 3 conditions.

    --
    I8-D