Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Advanced Requests and Responses in Ajax 209

An anonymous reader writes "The Web is no longer a place where simple applications are tolerated; 'users have become more advanced, customers expect robustness and advanced error reporting, and managers are fired because an application goes down 1 percent of the time. It's your job then, to go beyond a simple Ajax application that requires a more thorough understanding of XMLHttpRequest.' This DevWorks article tries to help developers use Ajax to build a solid foundation in which an application handles errors and problems smoothly."
This discussion has been archived. No new comments can be posted.

Advanced Requests and Responses in Ajax

Comments Filter:
  • CS101 (Score:4, Insightful)

    by slackaddict ( 950042 ) <rmorgan@NoSPaM.openaddict.com> on Wednesday February 15, 2006 @01:31PM (#14725551) Homepage Journal
    "...to build a solid foundation in which an application handles errors and problems smoothly."

    Um, aren't these concepts something we learned in college??? This is just basic stuff... although I think it highlights how RAD languages can teach you sloppy coding habits if you don't take the time do do things correctly.

  • nothing too new (Score:2, Insightful)

    by nuttzy ( 877548 ) on Wednesday February 15, 2006 @01:32PM (#14725563) Homepage

    I think the article covers some things that are missing in a lot of ajax classes available, but really is nothing new. My own ajax class is far, far superior (trying to get the okay from work to OSS it).

    Too many classes are using a global httprequest object. This is not good if you are doing many requests (though I suppose uses less memory). There's also no timeout for graceful handling of a slow server. I've done quite a bit in the way of error handling.

    At least this one doesn't make you learn a damn mini-language... a major pet peeve of mine!

  • Good for Them (Score:3, Insightful)

    by trongey ( 21550 ) on Wednesday February 15, 2006 @01:37PM (#14725605) Homepage
    ...This DevWorks article tries to help developers use Ajax to build a solid foundation in which an application handles errors and problems smoothly.

    That's good, because none of the commercial "enterprise class" software that I have to work with handles errors and problems smoothly. They just crash or send an error message that has no relation ot the actual problem.
  • Users.. (Score:5, Insightful)

    by onion2k ( 203094 ) on Wednesday February 15, 2006 @01:39PM (#14725624) Homepage
    users have become more advanced

    They really haven't actually. They've stopped being mostly geeks and academics and now the internet is open to all. Users are much, much less advanced today than they were ten years ago. What has changed in more recent times is that the users now they're think more advanced. They're presented with interesting social networks (FlickR, Blogger, deli.co.us, etc), and they're capable of using these straightforward interfaces with lots of handholding (rebranding categories as tags for example) and they get the impression that they're learning something. Does that mean they know, or care, what an XMLHTTPRequest is? Nope.

    The same goes for customers. Yes, they want advanced reporting and robust apps .. do they care how those are achieved? Generally, nope.

    As for managers being fired for an application being unavailable 1% of the time .. the article talks about AJAX .. AJAX relies on JavaScript. Between 7% and 10% of web users have JavaScript turned off either implicitly or due to their IE security level. Surely if you're creating an AJAX application then you must realise the application is already unavailable to 7% of users even when your server is up and running? If high availability is key then you'd better not be using anything beyond HTML.
  • by AuMatar ( 183847 ) on Wednesday February 15, 2006 @01:52PM (#14725738)
    The correct answer is c

    c)Have the people who understand the engineering write pseudocode algorithms and work hand in hand with real programmers.

    The advantages you get from this- code that doesn't look like shit and have major architectural short commings, and much easier/cheaper maintenance. While I'm sure an Aero can learn to do basic programming in a month or so, it does take a few years to write good, well designed code. Whereas an experienced programmer can write equivalent functionality in 1/10 the time. By working together, you end up with higher quality software for much cheaper. This is the same way you see EEs and MechEs working with programmers in the embedded world.
  • Re:CS101 (Score:2, Insightful)

    by Anonymous Coward on Wednesday February 15, 2006 @01:54PM (#14725749)
    Isn't that a contradiction? The whole point of RAD is the "R"... you know, rapid. As in, NOT taking time?

    Oh sure, *I* agree with your point about doing things the right way, but the average acronym loving project manager sees "RAD" and (aside from the "party-on dude" connotations), assumes it means he doesn't have to spend time developing. One of the many reasons I hate that term and encourage others not to use it. It convinves people not to think in a relative perspective... "Rapid" means "faster than doing it in C. Not fewer ticks of the clock. But people don't see that.
  • by Quarters ( 18322 ) on Wednesday February 15, 2006 @01:57PM (#14725767)
    Except that c) doubles the costs (at least) the company will incur. While it is the right answer from a technical standpoint, from a business standpoint it isn't optimal.
  • by tjr ( 908724 ) on Wednesday February 15, 2006 @02:01PM (#14725800) Homepage
    The Web is no longer a place where simple applications are tolerated;

    Sure it is. Most web applications that I use, whether if they make use of AJAX or not, could certainly be plenty usable and valuable without AJAX.

    AJAX makes some things possible that aren't possible using plain HTML, but it doesn't make ALL plain HTML so much better that it would be impossible to imagine the site without it.

  • by Radres ( 776901 ) on Wednesday February 15, 2006 @02:06PM (#14725835)
    But c) will also half the maintenance costs of your crappy code.
  • by blue_adept ( 40915 ) on Wednesday February 15, 2006 @02:06PM (#14725841)
    The Web is no longer a place where simple applications are tolerated

    Not so. Simple = GOOD, just look at the success of google; no fancy front end required. AJAX, like good special effects in a movie, can enhance the end-user experience when applied selectively and intelligently. They are NOT an end in themselves.

    The truth is, the web is a place were only USEFUL applications are tolerated, whether or not they use AJAX.
  • Re:Users.. (Score:3, Insightful)

    by mpcooke3 ( 306161 ) on Wednesday February 15, 2006 @02:17PM (#14725930) Homepage
    The problem is that for various well known reasons "we" (the technical community) have decided that most applications will be deployed over the web these days. As new users come onto the internet for the first time they access these applications and they quite naturally expect them to behave like other applications. Whether an application was accessed via the "Blue E" or by the start button they expect them to behave in similar ways. Internet users in the old days used to be looking at research papers and the users got used to expecting websites to look like pages of static text.

    Like it or not since we've bastardised the web in this way with forms, cookies, javascript, DHTML, AJAX, Tagging, etc, we have changed users understanding of what the web is. It's a shame that a standardised technology for deploying applications over the internet never took off and that we ended up having to use the mass of hacks that has resulted today in AJAX.

    On an unrelated note, Categories and Tags are not really the same thing.

    Normally there are a fixed number of categories and/or hierarchy of categories and items belong to one low level category only, categories are normally but not always defined by the site.
    Tags are arbitrary user defined keywords that are applied to items to help users search through items. Tags are always defined by users.

    Also outside of the web2 community most people understand categories and do not understand tags. My mum for example.
  • by jetxee ( 940811 ) on Wednesday February 15, 2006 @02:21PM (#14725954) Journal

    I agree with you. Content and usefulness matter. And Simple = BEAUTIFUL.

    Yet, Simple != Easy to create. And Simple != Low Tech. Simple = Nothing excessive.

    And as far as AJAX helps to save some mouse clicks and page reloads, it may be used to weave really simple web.

  • Re:AJAX? (Score:3, Insightful)

    by PsychicX ( 866028 ) on Wednesday February 15, 2006 @02:25PM (#14725986)
    So have they figured out how to have the back button not wreak havoc on the page yet?
  • by AuMatar ( 183847 ) on Wednesday February 15, 2006 @02:26PM (#14725995)
    Not in the medium to long term. The improved maintainability (and very likely, quicker turn around time) of the programmer's code will very quickly make up the cost and more. If a good programmer can turn an algorithm from an aero to code in 1/4 the time (which is not, by any means, an unreasonable assumption) you end up saving money very quickly- you can hire 4 aero engineers to code, or you can hir 1 programmer and 1 aero engineer. And the aero might have free bandwidth to do more aero based stuff as well.
  • Re:CS101 (Score:4, Insightful)

    by hey! ( 33014 ) on Wednesday February 15, 2006 @03:03PM (#14726241) Homepage Journal
    What the issue at hand boils down to this: knowing how to program in an asynchronous enviornment. If you've done it before, you can skim the article in under five minutes, because it's just a small and managemeable set of conventions that sets dealing with the XMLHttpRequest that would be new to you. The strategy is just common sense, if you've done this sort of thing.

    CS101 certainly touches on aspects of asynchronous programming, such as threads, but I suspect the student's first serious exposure is more likley to come in second or third year OS class. But in any case you have to expect a CS program to fill the student's heads with more knowledge than skills. I've even hired engineers with masters degrees who, while they had the basic theoretical knowledge needed to do this kind of work, don't have a decent feel for it.

    The reason is that while they learned the theory, in practice details have always been taken care of by some framework or another. For example some ajax frameworks work by callback functions; clearly they're doing just this stuff under the covers.

    I'm not saying this is rocket science; quite the contrary. Very, very little in CS is. Most practical skills in CS amount to this: attention to detail and taking care with making assumptions you make -- particularly knowing when an assumption can be trusted to hold and when it cannot. I've often reflected that doggedness and fastidiousness (well, mental fastidiousness at least) are equally important with intelligence in making a good programmer.

    The problem is that programmers always have too many details to manage. Succeeding is what differentiates the good ones from the bad, and experience is very helpful. As in many things, an ounce of prevention is worth a pound of cure. It's all to easy to be careless or inattentive in the wrong places. Believing you know when to do this is what converts garden variety laziness into the hubris. Getting this stuff right isn't hard, but getting it wrong isn't hard either, in which case you end up with hard to debug problems or systems that are unresponsive.
  • by SixDimensionalArray ( 604334 ) on Wednesday February 15, 2006 @04:23PM (#14726785)
    You know, this comment is not just funny, I find it rather ironic. Why do we try and force a "real application" through a web browser? The way we are treating browsers these days, it seems like they are less about information presentation/sharing and more about actual application-type functionality. I thought that was what all the GUI libraries that come with your OS were meant for!

    Rather than taking an incremental approach and altering the core purpose of "web browsing", why don't we get all of the major technology companies that exist today to agree to support ONE standard for the remote binding of locally displayed user interface components. That way, every company can make their own components and their own code, but everybody knows a standard way to bind network-based logic to an interface. I'm pretty sure this is what Bill Gates was after when he envisioned .NET, what Sun hoped Java would be, what Macromedia hoped Flash would be. It's clear that no plugin, no single method is dominant. All we have is a [slowly] improving mess of HTML, CSS and Javascript. AJAX makes a difference, but only so far as it accomplishes the goal of ONE standard for fat-client, desktop application type functionality.

    Seriously, are all the big players so greedy that they can't ALL band together, for the good of humanity and advancement of technology, to agree on ONE standard? ONLY ONE? Take some time, flesh out a good model, agree to standardize, build new products, free and proprietary, and let's make the shift to these well-defined products.

    I guess I'm biased... I've been developing web applications for years, and I recently was speaking with a long-time desktop GUI developer. This developer hasn't suffered nearly as many of the injustices that we web developers have, trying to shoehorn something into a "web browser". Of course, his application doesn't work on every OS and every type of system (terrible in and of itself), but hey, if we had ONE standard for UI binding to network-enabled logic (web-services, remote components, anything at all), maybe it could.

    SixD
  • by Run4yourlives ( 716310 ) on Wednesday February 15, 2006 @04:49PM (#14726980)
    To really ajax this site web two point oh style you'd have to have it automatically checking for new comments, new posts, alerts or notifications that someone's replied to you, modded a comment etc.

    No, those things would be useless... AJAX is about improving the user experience, not loading as much crap onto a page that you can, just 'cause.

  • by kibbled_bits ( 808617 ) on Wednesday February 15, 2006 @05:05PM (#14727121) Homepage
    It surely sounds like these aren't software projects at all. Kludge would be a very good word to describe that. There must be some development process (IE: Agile, RUP, etc). Problem is that people want the results of crappy code (quick), but not the side effects (bad quality). Unless as programmers we push back and educate our audience then we will never overcome this and plug the offshoring hole.
  • by Tooky ( 15656 ) <steve.tooke@gmai[ ]om ['l.c' in gap]> on Thursday February 16, 2006 @06:25AM (#14731194) Homepage
    Have the people who understand the engineering write pseudocode algorithms and work hand in hand with real programmers.

    Even better, get them to pair-program. I heard a talk at XPDay London recently by a guy from a company who build gear boxes. They had similar problems where either developers didn't understand the engineering well enough or the engineers produced poor code.

    They began to implement XP (which we don't need to go into) and had developers and engineers pair-program on the tasks. This was a huge benefit for them as not only did they get well developed code that worked in terms of the engineering, but they also began to spread the domain knowledge around the team. The engineers started to get a better appreciation of development, and the developers were starting to pick up some of the domain knowledge from the engineers.

It is easier to write an incorrect program than understand a correct one.

Working...