I’ve been beating the drum of component based GUI frameworks for Ajax for a while now. To understand why, I think it’s useful to look at the evolution of the desktop GUI framework and understand what makes them so successful. Over at ACM’s Queue publication, I came across an article that gives a nice overview of what an application framework does and the characteristics that make it successful. This following struck me as especially apropos with regard to most of the current Ajax frameworks.
A framework exhibits "inversion of control" at runtime
via callbacks. These callbacks invoke the hook methods of
application-defined components after the occurrence of an event, such as a mouse
click or data arriving on a network connection. When an event occurs, the framework
calls back to a virtual hook method in a preregistered application component,
which then performs application-defined processing in response to the event.
The hook methods in the components decouple the application software from the
reusable framework software, which allows each to change independently as long
as the interface signature and interaction protocols are not modified. Since
frameworks exhibit inversion of control, they can simplify application design
because the framework—rather than the application—runs the event
loop to detect events, demultiplex events to event handlers, and dispatch hook
methods on the handlers that process the events.
Inversion of Control, it’s not just for Spring anymore.
Seriously, though, how many of the current Ajax toolkits — I’m not sure that with the exception of appfuse it’s correct to call them application frameworks — give you IoC? I’ll be watching to see if they make the transition to frameworks and will give credit where credit is due.
