Mark Forster is a fan of IoC from his days in Spring-land. He found that he was “writing endless amount of code to just instantiate objects and wiring up dependencies in these objects” and decided that what was in order was Squirrel IoC.

To see it in action, we can look at a simple example. There are three files at play here:

My understanding of IoC is that it’s a nasty workaround for restrictions in statically typed languages such as Java – I don’t understand why you would want to use it in a dynamic language which provides so many other powerful techniques for managing code complexity.

When you use an acronym or an unfamiliar name, it helps if you define it. Yes, I can and will Google “IoC”, but it wouldn’t hurt to explain what a fairly obscure term like this means when you write an article about it.

In my experience IoC is a neccessary evil in larger projects using statically typed languages.. Java and C# come to mind. In JavaScript I fail to see the benefit honestly.. Unless he’s just writing it for the sake of writing it, which ofc. is fine too.

Comment by JD P — November 21, 2007

Squirrel was written to allow the UI components of Fixx, an enterprise application written in java, to be configurable via java server-side code.

Squirrel is actually part of a larger framework which attempts to seam together and compliment server and client technologies keeping markup free of inline script and allowing a separation of concerns between various client-side libraries and frameworks we choose to implement. The IOC container has been distilled and tweaked simply to play about with in other projects by our team.

It has been put out there on the web for other people who may find it interesting or may find another use for it. We will be keeping squirrel up to date as we improve are core framework so keep an eye out