hedgehog lab Bug Tracking, Defect Tracking, and Issue Tracking software for the enterprise.

If you are interested in a painless, user friendly, and powerful Bug Tracking Solution, that helps you write better software and deliver projects on time, check out fixx.
Mark Forster Nov 16

Squirrel IoC - bringing Javascript out from the dark ages

Javascript is now part of a list of mainstream technologies on which the latest web applications and Web 2.0 is being built. Yet, it is surprising that a majority of Javascript code and developers seem to be stuck in the procedural paradigm where endless functions follow one another without any code organisation.

This is not an inherent problem in trivial systems but when we are heading towards SOFEA (Service Oriented Front End Architecture) and more applications are becoming browser-based, it can become a nightmare trying to maintain all the Javascript code. This essentially means that even where there is good use of object oriented Javascript, you could end up writing a large majority of code to just load, instantiate and configure objects.

Good server-side frameworks solve the pain of loading, instantiating and wiring up objects by using the Dependancy Injection pattern and an Inversion of Control container, which we at hedgehog lab use effectively in the form of Spring and Windsor.

However, while developing fixx (though we use some cool frameworks like jQuery), I noticed that we ended up writing endless amount of code to just instantiate objects and wiring up dependencies in these objects.

In a recent eureka! moment, I decided to do something about this on our last “lab day” and write an IoC container in Javascript. The result of this is Squirrel. As you guessed, it is “an IOC container in javascript”.

The current version of Squirrel is designed to ease the development of fixx client-side Javascript, allowing a greater decoupling between the complex objects that make up client-side code in fixx and resulting in code that is easier to test, maintain and extend.

A word of warning that Squirrel is currently in it infancy, but provides enough of an implementation of IOC to work with simple client-side applications.

Squirrel is constantly changing and is currently under development but we have a decent road map up and when we have something substantial we’ll let you know. In the mean-time why not give it a try, give us some feedback or contribute to it yourself.

posted by Mark Forster on November 16, 2007 at 12:01 a.m.

Comments

Post a comment