1

So I've been reading about it and every example I've come across, explain the concept with something like this:

Original:

A ---> B

IoC:

A ---> :I: ---> B ---> C , etc

Where A originally consumes something from B directly. In IoC A consumes an interface for which B is one of many possible implementations.

Is this really all there is to Inversion of Control?

Omar
  • 14,695
  • 8
  • 40
  • 61
sergio
  • 938
  • 2
  • 16
  • 39

2 Answers2

1

This is like say Object Oriented is A:B. No IoC is not what you said, It has some purposes and one of a way to achieving its purposes is working like what you mentioned. If you see wiki article it uses some basic patterns (actually more than what wiki mentioned):

using a factory pattern
using a service locator pattern
using a constructor injection
using a setter injection
using an interface injection
using a contextualized lookup

Also Dependency Injection is one of a common concepts which involves when you doing IoC. I think if you read Martin Fowler's detailed article: "Inversion of Control Containers and the Dependency Injection pattern", you can understand it better.

Saeed Amiri
  • 21,361
  • 5
  • 40
  • 81
0

Apparently not. The wikipedia article says more on the subject than anyone here would want to say.

Michael Slade
  • 13,476
  • 2
  • 36
  • 44