Fremus.co.za

Demistifying Life and Web Development

A strategy for using AJAX on ur website

I have been thinking a lot recently about the use (or abuse) of AJAX on a website and it made me think of a strategy to try and adopt. Like all technological things it makes sense to understand the overall business goal first and then to proceed to the next step. It also makes sense not to focus too much effort in one area and neglect others. For instance, too much AJAX and JavaScript will create bigger and bigger .js files, which require more and more maintenance to try and keep small. On the other hand you cannot, not use AJAX, on or in your web applications these days. So whats the best strategy? Well I think you need to understand your business goals, and make sure that what you want to achieve can be achieved. Consistency is often something to strive for in this context, because being consistent is often far tougher than making one or two good impressions. The User Interface (UI) must be consistent throughout any application, rather than be too elaborate.

So to come back to my strategy for using AJAX in web applications, I think an approach I am going to try is to divide navigation into two classes:
*Website navigation
*Page level navigation

Website navigation will generally allow for “postbacks” whereas page level navigation will allow for actions that are very specific for that page. The MVC framework provides a structure that supports this strategy. Your views act as your “postbacks” and the actual views themselves are where the activity takes place. Postbacks in this instance refers to the flicker effect you get when you click on links, whereas AJAX allow for a smoother effect.

The other bit of strategy I would like to think about is processing the results from datasources through AJAX. At the moment I am developing web applications where the web services return HTML strings, and the JavaScript simple ends up displaying it. I feel that this approach is messy and does not allow for a clear and contextualised view of your system. There must be an approach that creates good quality AJAX that can interact with server side code. I am looking for an approach that will make it easier to develop and implement my classes. I love the classical object design approach because I like things organised that way.

  • Share/Bookmark
posted by fr3dr1k in ASP.NET MVC and have No Comments
Tags:

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment
Get Adobe Flash playerPlugin by wpburn.com wordpress themes