xp-framework/xp-framework — pull request #117 by mrosoiu (2012-01-25 10:56:28+00:00)
Title: ioc.DependencyInjectionContainer

This implements a simple D.I. container that can be used to do the final wiring required by D.I. mechanism (usually done in app bootstrap). This is an alternative to @mikey179's IoC port from Stubbles (see Issue #33).

What this implementation brings:

* D.I. is a simple concept that begs for a simple container implementation
* Inversion of Control on how you write your D.I.-aware classes: required dependencies are done only via Contructor, optional dependencies via Class Fields or Setters
* Clean documentable API (although the container exposes just 3 methods). `fluent interface` method chaining `$you->do()->something()->now()` is a mess when you read the generated API docs

Let me know what you guys think.

Cheers,
-- Marius