atomicobject/objection — pull request #22 by driis (2012-06-26 20:07:43+00:00)
Title: Inititializer dependencies support

This pull requests adds support for initializers to be truly dependent on types registered with Objection.
Currently, when using objection_initializer, one has to know the concrete dependency either when the type is registered, or when it is resolved. It would be nice to simply register the initializer one would like to use, and let it be up to Objection to resolve it's depencies when calling getObject; this is what this pull request adds.

You can now use objection_initializer like this:

objection_initializer(initWithEngine:, [JSObjectionDependency for:[Engine class]])

The first dependency will then be resolved when calling getObject, instead of being specified when the type is registered. Of course this also works the other way around for getObjectWithArgs, using JSObjectionDependency here allows you to override a dependency with whatever is currently registered with Objection.

There are tests for this in InitializerSpecs.m. Most of the new feature is in JSObjectionUtils.m.

I think this would be a nice addition to the Objection framework, and hope you will accept it. If you should agree with the feature, but disagree with the style or way it is implemented, please tell me and I will try to improve ;-)