So you’re trying to write loosely coupled code and you keep hearing this thing about inversion of control. Perhaps you read about it in the chapter on factories while reading your favorite design patterns book. Well to summarize, inversion of control is where a chunk of code acts as a container for another set of code, the container controls some overall algorithm or sets of algorithms and calls other code to implement certain portions of these algorithms. This is commonly referred to as the hollywood principle, “don’t call us, we’ll call you”. This could be as complex as an MVC framework or a simple implementation of template method somewhere in your codebase.