Question:
Is AJAX part of a good architecture?
Shank
2006-06-21 08:51:01 UTC
I realize what and how to use AJAX. I just can't convince myself that all that Javascript or Jscript is a good thing. It seems a bit "messy" to me. I'm thinking a good Flash implementation is a better solution from a maintenance perspective.
Four answers:
John C
2006-06-21 11:10:04 UTC
Flash pages, if that is what you want to call them, cannot be bookmarked. At least, forms and subpages within them cannot be. The same thing goes for working with the browser history (i.e. backward/forward arrows in the browser and the history in the View/History menu/sidebar).



A well designed website implemented carefully with AJAX, DHTML, HTML (or XHTML), and so forth - can be bookmarked. Just pay attention to your URIs.



AJAX is a feature users like when they see it. It can also make the web page much more responsible and seem a lot more useful.



At the same time, if the user has a noisy connection, they could get more problems and more complex failures than a traditional non-AJAX form that does not use any Javascript.



Furthermore, web browser bugs - like memory leaks, to name just one thing - are really going to be exacerbated by heavy use of DHTML (e.g. AJAX).



Javascript is built into the browser. Flash is not. Flash must be updated from time to time too, even if it did come with the browser. The Flash plugin is not particularly small.



Also, Flash lets a web page do things a Javascript-equiped page (or Java applet) cannot do. Some of those things, some users or computer owners/managers not want to let Flash do. You will be forcing them to allow it if you use them - they might reject your page. They might accept it if it uses Javascript/AJAX.



There are a lot of factors involved. Many of them will change for better or for worse, more than once, over time.



Besides, do you really think Flash will be around in 5 or 10 years?



Javascript will be and HTML or at least XHTML will be. Further, there are lots of free Javascript implementations out there. Far fewer Flash implementations, though.



Flash could be changed without notice, on one vendor's whim. Incompatible changes to Javascript would require a lot of approval and prior announcement lead time.



Javascript is an open standard. Flash is not.



The company that makes Flash has eliminated some significant products in the past couple years, as they juggle their priorities and eliminate duplication in the wake of mergers.



The possibility of such changes at one company affecting Flash are something to keep in mind in your "architecture". As architect, you have to be concerned with single points of failure, choke points, and risk analysis.



How will you maintain your Flash application when Flash eventually gets dropped, or a serious bug is discovered in it that affects your application - but it is beyond your power to fix the bug and there is no alternate implementation you can recommend switching to in order to run your application?
Ramses0
2006-06-21 09:05:47 UTC
AJAX can help guide you towards a good architecture- mostly because it forces you down the path towards providing individually consumable services rather than a monolithic architecture implementation. Simple example is search. Suppose you are yahoo and are writing your search engine. If you handle all that logic on one page or in one class then that's tough to re-use. However, if you AJAX-ify it, you get towards separating out (distinguishing) the individual services involved (searching, advertisements, paging, headers, footers, logged-in/out etc).



By making all of those individually "AJAX" (which is to say: individually callable services), you can then re-use them more easily by combining them in different ways from different programs or pages that consume those services.



That being said, yes AJAX does make the front-end more "spaghetti" if you're not careful (lots of asynchronous stuff, timing issues, potential race conditions, etc), but it tends to make the back-end more API / service-oriented, which tends to be a good thing.



In direct comparison to Flash, Flash will give you more "monolithic" control, which will avoid spaghetti on the front-end, but generally has a lower potential for re-use.
VanillaIce
2006-06-21 09:43:20 UTC
i lik ajax but the thing that pisses me off is that when you are trying to change the url in the browser window and wait for that url to load, but u accidentally place your mouse over an AJAX component, that component takes over and stops the loading of the url on top. For example, the new Yahoo homepage uses ajax and i have yahoo set as my browser homepage. when i try to change the url to..say..google..and after i hit enter, if i place my mouse over the weather icon, the weather loads and the browser stays right at yahoo instead of going to google.
JavaClark
2006-06-21 09:01:25 UTC
What ever scripting language you use: Use the one you are most comfortable with. If you prefer flash actionscript use it. Different people have different style. There are a lot of people doing AJAX, ask your peers/fellow programmers who are familiar for opinions.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...