20040114 Wednesday January 14, 2004

Inversion of Control - what the heck is it? I really didn't know what Inversion of Control meant, until I started reading Rod Johnson's book. Today, on the spring-user mailing list, and article was posted about Inversion of Control. The article is by Martin Fowler and is titled Inversion of Control Containers and the Dependency Injection pattern. If you don't understand all this IoC stuff, or just want to learn why Spring and PicoContainer are the talk of the town, you should read this article.

On a side note, the guys at TheServerSide shouldn't feel bad about not setting their background color - Martin Fowler is no HTML genius either. Posted in Java at Jan 14 2004, 09:59:06 AM MST 6 Comments

Comments:

Hmm.. one thing I just don't get about MF's IoC examples is why one wouldn't just use a factory to load class implementations from the classpath. IE, Foo foo = FooFactory.getInstance().getFoo(); The FooFactory class can instantiate itself OR some implementing instance of itself - that then can return different types of Foo implementations.

Posted by Unknown on January 14, 2004 at 01:21 PM MST #

There you have missed one of the points of IoC (as was) - the whole point is the object itself that requires the dependency should be completely passive. The simplest way to think of IoC is that an object exposes its need for dependency, and an IoC framework provides the dependency - it becomes the dependency glue for your application.

Posted by sam newman on January 14, 2004 at 06:03 PM MST #

I just had to point that one out... ATG's Nucleus technology is IOC done right, and was available in the previous century. At least is nice to see the rest of the world finally catch up.

Posted by Sebastiano Pilla on January 15, 2004 at 03:45 AM MST #

Heck, IoC is just the Dependency Inversion Principle which has been around for ages...

Posted by Sam Newman on January 15, 2004 at 04:42 AM MST #

Sam, do you menan the Dependency pattern in the GoF book?

Posted by Jack Herrington on March 31, 2004 at 11:24 AM MST #

Ek....now you out me on the spot - don't have the book to hand, but you can find a white paper on DIP here: http://www.objectmentor.com/resources/articles/dip.pdf Oh, and I wrote an article on the subject of IoC here: http://today.java.net/pub/a/today/2004/02/10/ioc.html

Posted by Sam Newman on March 31, 2004 at 12:02 PM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a Web Architecture Consultant specializing in open source frameworks.
« May 2012
SunMonTueWedThuFriSat
  
1
2
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
23
24
25
26
27
28
29
30
31
  
       
Today

Recent Entries

Tag Cloud