Inversion of Control Containers: Practice and Assignments

Lecture Notes

In order to complete this assignment, you need the lecture notes on IoC containers.

Bibliography: Martin Fowler: Inversion of Control Containers and the Dependency Injection Pattern, link

Lab Assignments

The goal of this assignment is to understand the design of Dependency Injection Inversion of Control containers. For this purpose, you will implement a simple "Homemade IoC Container" (actually a small competitor for the PicoContainer, the Spring Container or other known IoC Containers ;-) ). (Of course, you may NOT use any of these existing containers in your assignment!)

Homemade IoC Container: Design and implement a IoC container. Your container will require that components follow a certain convention for dependency injection (constructor or setter). A second requirement for your container is that it accepts configuration information given in configuration files. You may choose any format for the config files (XML files, text files). Also, design a small API for clients to retrieve the composition from the container (you may find a source of inspiration in the Spring example).

Demonstrate the genericity of your framework by developing 2 different component-based applications on top of it; one of the applications can be the MovieLister+MovieFinder scenario.

Credits: by doing correctly and in time this assignment you can obtain a maximum of 4 lab points. The Deadline: Week 7

Practical resources

The implementation of the IoC container has to rely on reflection for instantiating components and their wirings. Some usefull resources on reflection: