I asked a question here which was down voted. Let me put the question here:
" I know that dependency injection (DI) is one kind of Inversion of Control (IoC). There might be different types of examples that show IoC but not DI.
"inversion of control (IoC) is a design principle in which custom-written portions of a computer program receive the flow of control from a generic framework"
Can you show how each of your examples in code conform with Wikipedia definition ? I am particularly interested to find in each of your example the following terms and techniques from the mentioned definition :
1) Which part of your code is custom-written ?
2) Which part is the generic framework ?
3) What is the flow of control that is received by the custom-written portion from a generic framework ? How does the 'receiving' take place ?
They say that this question sounds to be a homework assignment. I came up with this question while preparing for an interview.
Can you point out the weakness of this question and how to improve it anyhow ?