Wednesday, February 28, 2007

Some notes on Venkman

On a side note, after writing the bit on Venkman for the chapter on Debugging Client-side Code, I have to say that I have a whole new respect for the tool. I've generally fallen into the category of developers who installed Venkman, got a little overwhelmed at the interface, and moved on to other things in the rush to simply get things done, but I feel honestly quite a bit relieved to have sat down and gone through some use cases with it and actually learned how to use the amazingly flexible a tool. You can, for example, almost exactly replicate Firebug's JavaScript debugger within a remarkably small subset of Venkman's tools.

Additionally (I suppose, on a side-side note), Svend Tofte's tutorial definitely helped me discover some of the not-quite-so-obvious functionality Venkman offers. It doesn't provide (so far as I can tell, at least) the DOM Inspector hooks or anywhere near as concise or precise profiling as Firebug has available, but I have yet to see anything even close to its granularity around breakpoint management, from Meta Comments to conditional continuation, to Future breakpoints vs. standard breakpoints.

Labels: ,

Last call for the XMLHttpRequest object spec

The working draft for the XMLHttpRequest object has just reached the Last Call. As someone who touts the use of web standards fairly heavily, both in and out of the book-in-progress, having the ability to stop saying,"Follow web standards...except for this one bit of functionality the entire application centers around," definitely appeals.

Labels: ,

Tuesday, February 20, 2007

Rounding out chapter 3

Looking again at the UserProfile object, almost every aspect of it, from the events object to the loadValues method, can easily get pulled out into a parent object that other data models can extend. The same also goes for the ProfileController object. Using inheritence in this manner not only prevents writing redundant code, it also vastly reduces the amount of JavaScript the browsers must download in order to run the web application in the first place. Data objects then only need to contain the code specific to that data, such as custom validation or authorization checks, rather than requiring that each data object also manage its own communications with the server.

Coupling the power of inheritence with the MVC pattern, an application gains a wealth of power in the form of quickly developed modules of functionality, supporting the overall application structure. Data filtering, cleaning, and management get supported by default, along with automatic updating of the server with the appropriate data no matter how convoluted an interface the user uses to interact with it.

These methodologies, combined with event-driven application development, provide a well-rounded base for many Ajax-driven applications. By using events to trigger actions throughout the application, objects stay abstracted enough for reuse in multiple interfaces, without the need for custom code to "hook in" the objects needing to interact with it.

As with all patterns, they should get regarded as tools to use for their suited purpose rather than rules to follow. The MVC pattern can add unnecessary layers to an otherwise small and simple interface. Event-driven architectures can add meaningless abstractions and hoops to jump through when dealing with large data sets or "streaming" results. In short: design the application for the requirements at hand. Doing otherwise will add complications and make the code much more difficult to maintain and debug.

Labels: , ,

Wednesday, February 07, 2007

An added benefit to writing the book

As I work on the third and fifth chapters (on accessibility and client-side debugging, respectively), I've found a few new tools and added them to my own list of actively installed tools:

Web Accessibility Toolbar for Opera
I've known about and used the Web Developer Toolbar & Menu for a while, but this takes a huge amount of the features I know and love, and adds in the accessibility analysis features I've wanted for a while now, such as contrast scaling and greyscale rendering.
Opera Developer Tools
A few incredibly useful scripts for working with CSS/XHTML/DOM in Opera:
  • DOM Console
  • CSS Editor
  • DOM Snapshot
Firevox
When I asked about Mac screen readers I could use while writing Ajax examples, David Poehlman pointed me to Firevox, which (once I got past a couple permission issues) installed quite easily and seems to work really well so far. I haven't tested it out extensively yet, but it even has support for WAI-ARIA markup!