Alex Rivera | Logout

What is Inversion of Control?

Asked 2008-08-06T03:35:27.380
2350

Inversion of Control (IoC) can be quite confusing when it is first encountered.

  1. What is it?
  2. Which problem does it solve?
  3. When is it appropriate to use and when not?
Edit
Report

1 Answer

19

I agree with NilObject, but I'd like to add to this:

if you find yourself copying an entire method and only changing a small piece of the code, you can consider tackling it with inversion of control

If you find yourself copying and pasting code around, you're almost always doing something wrong. Codified as the design principle Once and Only Once.

answered 2008-08-06T05:20:11.037

Your Answer