DEV Community

Cover image for Inversion Of Control: Pt 0 - Introduction

Inversion Of Control: Pt 0 - Introduction

miketalbot profile image Mike Talbot 惻Updated on 惻1 min read

I've been wanting to write an article about using "Inversion of Control" for a while. Inversion of Control is a very powerful technique that:

  • Deals well with shifting requirements
  • Handles customised versions of software for different clients (including in multi-tenant systems)
  • Works brilliantly with distributed teams working on the same code base
  • Reduces the amount of time spent testing core components and checking whether you broke one
  • Is not something in any way specific to games

Alt Text

IoC has been a core part of my architectural toolbox for many years, but here's the rub, with simple examples it's just too easy to say "Oh that just makes it complicated".

To address this I've decided to make a project that is not totally trivial. In this case a game. I intend to write a few articles discussing how IoC works in this context.

The game uses js-coroutines for animation and a new event bus that I will go through in detail.

For now I thought I'd just show off the project. A simple game with an annoying control system! You push floating apples around (and have to master the technique for doing it). Pop some bubbles along the way.

Discussion (2)

Editor guide
lifelongthinker profile image

Just awesome šŸ‘šŸ˜€
I have been collection articles on SOLID for teaching purposes, this one looks like it's going to get a very special place in my collection. Looking forward to reading the following installments. šŸ˜šŸ˜

miketalbot profile image
Mike Talbot Author

That's great, I will be sure to be referring to SOLID given that nudge!