Friday, September 27, 2013

IOS Dependency Injection vs Singletons

Having lived with dependency injection for most of my professional Java programming career, it seemed natural for me to seek out similar solutions in IOS. This one looks quite promising.

https://github.com/jasperblues/Typhoon

It seems like a good idea to have singletons injected into the right places so various components of the game can coordinate, such as the game controller and the UI controller.

Alternatively, the singleton pattern might be more straightfoward and appropriate for my tiny snake with lazers game:

http://www.galloway.me.uk/tutorials/singleton-classes/

I will do some tire kicking and update on how that turns out.

No comments:

Post a Comment