Reputation
275
Top tag
Next privilege 300 Rep.
Create new tags
Badges
2 8
Newest
 Commentator
Impact
~3k people reached

  • 0 posts edited
  • 0 helpful flags
  • 6 votes cast
Feb
24
comment Does merely parameterizing a dependency meet the requirements for Inversion of Control?
It seems like an arbitrary distinction to me. However I can see you've stuck very closely to Fowler's definition and ultimately it seems this comes down to semantics so I have to agree. I guess unless I'm writing a "framework" then I don't need "IOC".
Feb
23
comment Does merely parameterizing a dependency meet the requirements for Inversion of Control?
That depends on what is 'my' code and what is 'framework' code. Are you saying that if the repository the 'framework' then it isn't IOC, but if it's the other way around (repository is 'my' code), then it is IOC? Surely if a third party came along and wrote an implementation of IAddressRepository (and also assuming the method was public) then that would be inversion of control because 'my' code is calling 'their' implementation?
Feb
22
comment Does merely parameterizing a dependency meet the requirements for Inversion of Control?
Thanks for your answer. I think part of the confusion is the difference between IOC and DI, which, in my experience, people use synonymously. One question though - the example of the IComparer is very similar to my example. Would you say my example is IOC? If it's not, would making the parameter mandatory change that?
Feb
22
awarded  Commentator
Feb
22
comment Does merely parameterizing a dependency meet the requirements for Inversion of Control?
@DocBrown Thanks that makes for interesting reading and is certainly in the same area. But I don't think it addresses my question, which is whether or not the example above can be considered inversion of control, or dependency injection, or if it's just a somewhat handy pattern which would be further improved by factoring in some way.
Feb
22
comment Does merely parameterizing a dependency meet the requirements for Inversion of Control?
@RobertHarvey You're right that there's no object which contains an instance of the dependency, but the method, and therefore the class, which contains the static method still has a dependency on AddressRepository, in so far as it requires that class to exist in order for it to function. My question is, does the parameterisation of the dependency meet the requirements for "inversion of control"? Does it matter if the parameter is optional or not?
Feb
22
asked Does merely parameterizing a dependency meet the requirements for Inversion of Control?
Jun
13
awarded  Yearling
Feb
26
awarded  Caucus
Jul
4
awarded  Good Question
Jul
3
awarded  Popular Question
Jul
1
comment Are programmers bad testers?
No one is aware of any research or data on this issue?
Jul
1
comment Are programmers bad testers?
I think this answer hit the nail on the head when it points out that "If you've written the code, you (should) have already thought of as many ways as possible that things could go wrong, and have dealt with them."
Jun
29
awarded  Nice Question
Jun
29
comment Are programmers bad testers?
I actually agree, but what I want to know is what evidence there is to say that this is true most of the time and for most developers. If I want to give general advice to people that developers make bad testers (or even bad testers of their own code), then I should have evidence for that assertion beyond my own experience, if at all possible.
Jun
29
comment Are programmers bad testers?
Thanks for asking that. I updated my question to say what I consider testing to be. Basically, testing is stuff that happens after the software has been built and deployed, not during development (like unit testing) or as part of a development methodology (like peer review).
Jun
29
awarded  Editor
Jun
29
revised Are programmers bad testers?
added 328 characters in body
Jun
29
awarded  Student
Jun
29
asked Are programmers bad testers?