Web Info & Tutorials

December 6th, 2006

AJAX OPENREPORTS REPORT VIEWER

Erik Swenson of Open Reports has created an Ajax Report Viewer: OpenReports Report Viewer.

The example uses YUI and YUI-EXT. Click to see the flash demo.

December 6th, 2006

DOJO 0.4.1: STABILITY, PERFORMANCE, AND MORE

The Dojo Toolkit has a new version 0.4.1 release.

We talked to Alex Russell about the release:

What is good about 0.4.1

It’s a stability and performance release so we recommend it for everyone who was already using 0.4.0. For those folks, it should be a very straightforward upgrade. The last major release added a lot of new features and in the intervening time we’ve had a chance to shake those things out a bit more. Notably:

  • James Burke’s excellent work (thanks to AOL) on safe cross-domain XHR has yielded a solution for IE 7. This is the best way to do serious, safe cross-domain work while we wait for something like Doug Crockford’s <module> proposal to be implemented by the browsers.
  • resource and localization “flattening” for builds makes the system perform better when using i18n.
  • a native dojo.storage provider for the WhatWG storage APIs. Apps that have been using the Flash storage provider don’t have to change any of their code to take advantage of it. It Just Works thanks to Brad Neuberg.
  • we spent a *lot* of time adding documentation for many of the previously opaque modules. Owen Williams, Carla Mott, and Neil Roberts have been building tools and herding cats to get this done.
  • Bill Keese and Liu Cougar closed more bugs than everyone else combined while they polished and and improved the widgets. Everyone using widgets should see the impact of their work in improved reliability.

Why should people upgrade?

If folks were holding out on 0.4.0, I think think they’ll be happy with the state of thing in 0.4.1.

What is next on the agenda?

We’re keeping the roadmap at:

http://trac.dojotoolkit.org/roadmap

What’s not outlined there right now is that we’ll be plugging the new data binding layer into the widget system and making changes to the template syntax to support that. This is exciting work and the culmination of a huge amount of background work by some very smart people.

Data binding will allow us to more quickly attach widgets to services and systems, and I’m excited that we’re in the home stretch for getting it done.

December 6th, 2006

CREATING EXTENSIBLE PROTOTYPE WIDGETS

Justin Palmer has written about avoiding bloat in widgets with respect to Prototype.

Widgets walk a fine line between abstractions and implementations. Implementation, in this case, is a practical solution chosen to perform a given function. The problems with widgets occur when the widget author walks too far in one direction, or worse, walks an outward spiral covering both directions. Both choices lead to script bloat and complexity thats hard to manage. You no longer have a simple solution for a defined problem, you have a complex solution for a variety of problems. The good news is there are ways to avoid both the bloat and complexity.

He details the world of extending classes in JavaScript, and then gets to actsAsAspect, which lets you get AOP-y via before, after, and around advice.

function actsAsAspect(object) {
  object.yield = null;
  object.rv    = { };
  object.before  = function(method, f) {
    var original = eval("this." + method);
    this[method] = function() {
      f.apply(this, arguments);
      return original.apply(this, arguments);
    };
  };
  object.after   = function(method, f) {
    var original = eval("this." + method);
    this[method] = function() {
      this.rv[method] = original.apply(this, arguments);
      return f.apply(this, arguments);
    }
  };
  object.around  = function(method, f) {
    var original = eval("this." + method);
    this[method] = function() {
      this.yield = original;
      return f.apply(this, arguments);
    }
  };
}
 

As someone who has worked with AOP via AspectJ and other libraries, it makes me a bit queasy to consider this AOP. One of the key elements is the pointcut language, which is very primitive here.

I do like the conclusion though:

While this is a rather convoluted example, the premise is solid. When creating widgets, don’t over abstract, and avoid hacking when possible. Even though we jazzed up our widget in the end, it’s original purpose is still intact and we added no additional overhead to it. Those who want ”more cowbell” can get it by plugging-in the additional scripts.

December 6th, 2006

CSSDOCS.ORG: CSS DOCUMENTATION HELPER

cssdocs.org is a place launched by Pete Freitag that lets you:

  • Search CSS substantiation using a script.aculo.us supported machine rank search
  • go direct to a address much as css.docs.org/background to impact that property

CSS Docs