
Inversion of Control (IOC), also known as Dependency Injection (DI), is a design strategy that has become popular in software development over the last few years, leading many Flex developers to explore frameworks such as Spring ActionScript, Parsley, Flicc, and Swiz.
In a nutshell, IOC is an approach in which a separate object is responsible for populating the fields of other objects with correct implementations, instead of these other objects being responsible themselves. One benefit of this is that you can decouple an object from implementations by declaring the object's fields as interfaces (known as design by contract). Second, by removing creational logic from the object, you make the purpose of the object clearer.
An IOC container provides a framework that helps you adopt this pattern in a consistent and declarative way. Combining this strategy with interfaces can help you create objects that are testable and flexible. For a more in-depth description of the IOC pattern, see Martin Fowler’s article on Inversion of Control Containers and the Dependency Injection pattern.
Java and .Net IOC frameworks are already established, and recently there has been a lot of activity within the Flex community in this space.
In this article, I will describe some of these frameworks, providing a brief overview of how they work and how they compare to each other. To compare implementation requirements, I’ll be applying the Spring ActionScript, Parsley, Flicc, and Swiz frameworks to the same benchmark project, ProfileViewer.
In order to make the most of this article, you need the following software and files:
Knowledge of Flex is required.

This work is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License.
Ed Eustace is a senior technical consultant with Adobe Professional Services EMEA.