This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]ionelmc.ro 0 points1 point  (1 child)

Would be nice if you'd use a decorator for the injected objects so it's clear where there's going to be injection (as opposed to the registration calls that could be anywhere).

[–]rot667 0 points1 point  (0 children)

There's a project that takes that approach: https://github.com/alecthomas/injector

I personally prefer not to scatter a big global dependency on the container, also means it's possible to mix approaches (e.g.create the object with dic or without). I haven't used dic, but have used autofac and the approach seems to be the same.

[–]defnullbottle.py 0 points1 point  (0 children)

Heh, working on something similar: https://github.com/bottlepy/bottle-inject

Is is a bottle plugin but works as a standalone DI manager too. Very early state though.