Over the past month, or so, I’ve been working on a Super Double S33kr1t project for a friend of mine. Without going into too many details, it’s a web-based management application for a new business he’s starting up. We decided to make it web-based so that he could connect to it from anywhere and see how his business is doing. However, since the application will also be used locally at the business, I wanted to approximate the speed and responsiveness of a local app. So I’ve finally dipped my feet into AJAX, also known by the much less sexy name XMLHTTPRequest.
Ajax stands for ‘Asynchronous Javascript and XML‘, or something along those lines. Point is, up until last week or so, before I started working on the actual application coding, I knew nothing about it other than that it existed, and that everyone was all worked up over it for some reason. Don’t get me wrong, I thought AJAX was pretty darn nifty: it allows parts of a webpage to be manipulated and comunicate with a database without having to reload the entire page for every little change, which enables a lot of really cool effects and the ability to write web apps that can be just about as responsive as one running locally. But I wasn’t exactly chomping at the bit to master it, either. The vast majority of my coding these days is in Visual Basic (and that’s VB6, not VB.NET, even) for maintaining old legacy apps for our clients. And when I do any web coding, it’s almost invariably in ASP rather than PHP (although AJAX can be used easily in each one). But, still, not environments that really lend themselves well to experimenting with new things.
Then this new project dropped into my lap, and I decided to take a chance on it and see if this AJAX stuff is all it’s cracked up to be. I didn’t actually get to the web programming until this past week; up until this point I was mostly doing database work. The application keeps track of a fairly large number of interrelated variables, with a lot of things tied together in ways that aren’t always obvious. We’re not talking about an app to organize your CD collection here.
Therefore, figuring out how to properly structure the data into different tables, how and where to tie tables into one another, and documenting what I was doing so I wouldn’t be completely lost later when I started crafting up the SQL statements for reports and lists, is very, very important. I’ve learned from experience that a properly structured database at the begginging can save you, literally, weeks of coding effort later on, especially if any changes are requested to the application. Adding or substracting even a single field from a badly designed database can mean having to go through the entire project codebase later on to make sure everything still works. To top it all off, I’ve been working on this app only during my spae time, which, as you may have gathered from my last post, is at a premium these days. So, it took me several weeks and a couple of grudging ‘back-to-the-drawing-board’ moments, but I finally got a workable database in place early last week. Now it’s time for some AJAX.
I suppose that deciding to learn a new programming technique by using it in a huge application may not be the smartest move I’ve ever done, but, luckily, I already knew a lot of the basics behind the core AJAX concept: instead of passing variables and receiving responses and reloading the entire page to display those reponses, I pass the variables over to the little AJAX object, it passes them on to the main script, receives the reponse, and updates just the parts of the page that need updating, without having to reload the whole damn thing. Nifty. Unfortunately, I’d become a bit rusty in my javascript skills, which led to a few false starts and stupid mistakes at first. However, I think I’m getting the hang of it now, and I already have a couple of the main program screens working at about 70% capacity. I’ve also been trying a few things I didn’t think we’re possible in web-based apps before, and I’m liking what I’m seeing.
The application itself if about 10-15% done, overall, but I really expect that number to go up rapidly now that I’ve gotten the hang of this. Plus, the fact that new code ideas keep popping up, means that I’m more willing to spend more of my leisure time on this than I was before, which should also accelerate the final development of the app. And, as a side-bonus, once I’m done with this, I can proudly put on my resume that I am proficient in AJAX coding, and will even have an app I can point at to prove it. 
(more…)
Technorati Tags: project, web-based, management, business, AJAX, Javascript, XML, VB6, PHP, database, SQL