Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So why not just pass its dependency as a constructor argument?


Passing a dependency as a constructor argument is dependency injection:

http://en.wikipedia.org/wiki/Dependency_injection#Constructo...


Right, my point was more "why do you need a framework to call constructors for you?".


That's what IoC containers do, or via setter.

However a IoC container can automatically create, and send through the object based convention(IMessageQueue -> MappedTo -> MessageQueue) or configuration (IMessageQueue -> MappedTo -> APMQMessageQueue).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: