Wednesday, May 09, 2012

We don't need no IoC tutorials! [um..right? Okay... yeah... well maybe a "review" wouldn't hurt... um... yeah...]

CodeProject - Inversion of Control: Overview with Examples

"Introduction

Definition: “Inversion of Control is an abstract principal describing an aspect of some software architecture design in which the flow of control of a system is inverted in comparison to procedural programming.”

What happens in procedural programming is a chunk of code that uses or consumes another chunk of code is in control of the process. It knows what piece of code, which method, in which class, it uses and this way it knows about the implementation details in the code it uses.

...

What is Dependency in terms of classes?

The example mentioned in the start of this article is an example of dependent classes. When class X uses a method of class Y or class Y as a whole, we can say that class X has some level of dependency over class Y. Dependency may extend to several levels. X uses Y, Y uses A and B, A uses C, and more. This way this chain goes on and on. The problem with this is if we have any change in these classes, it may spawn to multiple classes. The solution to this dependency problem is define a loose relation between classes. One way to achieve this is the Inversion of Control pattern. This pattern uses Dependency Injection to eliminate tight coupling between objects. Let’s see dependency with some practical example.

...

image..."

Heard of IoC/Inversion of Control but that's about it? This is a nice article that will help you wrap your head around the idea.

No comments:

Post a Comment

NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...

ALL comments are moderated. I will review every comment before it will appear on the blog.

Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...

I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...

Please see my comment policy for more information if you are interested.

Thanks,
Greg

PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...