Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming Java The Internet IT Technology

Better Web Apps With Ajax 184

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."
This discussion has been archived. No new comments can be posted.

Better Web Apps With Ajax

Comments Filter:
  • An "arrr" solution. (Score:2, Interesting)

    by Anonymous Coward on Thursday September 22, 2005 @07:09PM (#13625772)
    I much prefer a seaside [seaside.st] solution.

    --
    The "are you a script" word for today is platform.
  • by MarkEst1973 ( 769601 ) on Thursday September 22, 2005 @07:13PM (#13625791)
    JSON [json.org] 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.

  • Erlang and AJAX (Score:1, Interesting)

    by CorruptMayor ( 915031 ) <CorruptMayor@gmail.com> on Thursday September 22, 2005 @07:19PM (#13625831) Journal
    There's been an interesting discussion on the Erlang mailing list about a possible AJAX implementation. http://www.erlang.org/ml-archive/erlang-questions/ 200509/msg00282.html [erlang.org] http://www.erlang.org/ml-archive/erlang-questions/ 200509/msg00320.html [erlang.org]
  • by tjasond ( 680156 ) on Thursday September 22, 2005 @07:36PM (#13625924)
    Why not just use Echo2 [nextapp.com] and not have to worry about the details of an AJAX implementation for Java? I generally prefer not to reinvent the wheel, and with all of the various browser quirks with respect to AJAX, that's quite a non-trivial wheel to try and recreate.
  • Ajax, Java, Echo2 (Score:2, Interesting)

    by cbozic ( 679475 ) on Thursday September 22, 2005 @07:52PM (#13626011)
    TrackIt [sf.net] is an application that takes advantage of all of the above technologies.
  • by strokerace ( 912726 ) on Thursday September 22, 2005 @07:54PM (#13626022)
    There's a pretty good library I've used recently called DWR [getahead.ltd.uk].

    If you're looking for a Java library to do some of the heavy lifting, check it out.
  • by The Bungi ( 221687 ) <thebungi@gmail.com> on Thursday September 22, 2005 @07:54PM (#13626026) Homepage
    For that matter you could use something like YAML [yaml.org] and get over your problem with the "koolaid". If web services are useless from your POV that's fine, but some of us use XML for stuff other than doing OOB requests in JavaScript.

    You can move anything over HTTP, and as long as the receiving end understands you, you'll be OK. You can move INI files if you want. But some people prefer to use existing infrastructure (stable/tested parsers, WS-*, schema validation and so on) so as to avoid reinventing the wheel. Reinventing the wheel is expensive. So you take a small hit on the badwidth. Most people are not Google so they don't have to worry about measuring transport bandwidth overhead in terabytes and spending a year doing characterization testing.

  • AJAX can be fun! (Score:4, Interesting)

    by Klowner ( 145731 ) on Thursday September 22, 2005 @08:06PM (#13626092) Homepage
    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/ [dugnet.com], all that's needed are some AJAX functions to swap out the contents of each window, instant freakish web-app thing..
  • by fzammett ( 255288 ) on Thursday September 22, 2005 @09:02PM (#13626310) Homepage
    Since everyone else is mentioning their favorite AJAX toolkit, I'll list one too:

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

    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/ [sourceforge.net]
  • by fireboy1919 ( 257783 ) <rustyp AT freeshell DOT org> on Thursday September 22, 2005 @09:19PM (#13626382) Homepage Journal
    complaints about "bloated" XML are meaningless outside of a context that takes the application's overall bandwidth requirements into account

    Totally untrue!
    There's also the issue of latency and local computation time. The less time between the click of a button, and the reciept of data, the better it is.

    The lower bound is very, very low, and every little bit helps.
  • by CastrTroy ( 595695 ) on Thursday September 22, 2005 @11:04PM (#13626779)
    I already get mad enough at developers that do everything in flash. God forbid I want to find out about the newest blockbuster movie without having my computer bogged down with tons of flash filled with impossible to find information. I don't see why everyone is out there to make the browser do more work then it really should. We have a hard enough time getting browsers to display HTML correctly. We don't even know what's going to happen with random browsers that are out there that may or may not interpret the JS correctly, or there may even be bugs in the code, causing something to not render correctly, giving users a really bad experience.
  • Re:Atlas (Score:2, Interesting)

    by ThinkFr33ly ( 902481 ) on Thursday September 22, 2005 @11:05PM (#13626780)
    Funny, because I both drag/drop controls AND understand what's going on under the hood. Why? Because I know what I'm doing.

    ASP.NET lets me develop web applications that are fast, cross platform, and extremely robust. When I encounter a cross-browser issue, I look at the HTML and I fix it.

    Blaming Microsoft when you should be blaming ignorant developers is plain stupid.

    Are you arguing that development tools and platforms should be inherently difficult to use so that the chance of a stupid developer getting anything done is minimal?

    Making a platform difficult to use results in even the smart developers getting less done. I would rather risk facilitating idiots than not giving the smart developers the best bang for their buck.

    ASP.NET is about a lot more than drag/drop. It's about creating an event-driven web development platform that comes just about as close as you can get to separating code from presentation. It's about making everything as object oriented and encapsulated as possible to both facilitate reuse and help maintainability. It's about providing an incredibly rich development platform that frees up developers to concentrate on features and business logic.

    I'll give you a simple example. I was tasked with exposing a large portion of an existing web site to mobile users. This site needed to be accessible by a wide variety of cell phones, PDAs, and other mobile devices. Normally, this task would be huge. I would have to detect virtually every model of phone and render things just a little differently.

    Thankfully, ASP.NET Mobile Controls do this for me. They have what amounts to a huge browsercaps file and the controls sense the requesting device and modify their output accordingly. I went from zero mobile support to supporting thousands of kinds of phones in about 3 days... and all of that 3 days was spent doing easy if not mundane things like figuring out the best flow for the mobile version of the site.

    On the other side of things, I've used ASP.NET to create applications that handle millions of requests a day. One application I recently finished mimics Google's AdSense technology. I can easily support over 1000 requests a second on a single Dell server with fairly modest hardware. (2.4 Ghz, 1 GB ram.)

    ASP.NET also has some awesome reliability features. I can make a change to a site and all existing requests are fullfilled using the previous version while all new requests are run on the updated version. This means not a single request is lost, even when deploying a new version of an application. I deal with applications that must have 100% availability... not a single request can get lost. Ever. Is this possible without ASP.NET? Sure! I could bring down a segment of my web farm at the load balancer, update that segment, bring it back online, and then move to the next segment... but that's a pain in the ass. And that's just one small example. There are hundreds more.

    So stop bashing something you obviously don't really understand. Go back to writing your web apps in PERL or PHP or JSP and enjoy it. You don't know what you're missing.
  • Re:Atlas (Score:3, Interesting)

    by ThinkFr33ly ( 902481 ) on Thursday September 22, 2005 @11:50PM (#13626940)
    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?
  • No you can't. You have to use CGI and rerender the entire page if you're doing that.

    You might as well use html if you have to redo the whole page anyway.
    Repeat this to yourself until you remember:
    WIRE PROTOCOL! WIRE PROTOCOL! WIRE PROTOCOL!

    Its not for making a page! Its for moving data from server to client! Just data! Thats the whole point! And it requires javascript. Without javascript, you can forget all of it entirely.

So you think that money is the root of all evil. Have you ever asked what is the root of money? -- Ayn Rand

Working...