Jul 03, 2014 04:58 AM|Rob89|LINK
I definitely agree with you in places but I think we'll just have to agree to disagree with regards to the Controller factory - I see what you're saying but I just don't see it as a problem :)
I'm not sure why but I feel uneasy about a container in the framework "reaching out" to my code. It looks like the framework is going to have some all powerful object that you say: "Hey champ, when one of my controllers asks for IMyService can you give them
this MyImplementation?". Why do I have to configure the framework to know how to resolve my controller's dependencies? Why should it care? All it needs to be able to do is create one. I know how to create my controllers, (possibly using a container to resolve
dependencies) why shouldn't I just give the framework a factory that it can use?
As I said, definitely on the fence at the moment. I can see how having a container helps (as you pointed out, lifetime management etc.) but I feel it's my responsibility to decide if I'm going to use one and the framework shouldn't push that on me.