EnsignPayton / MonoGame-Test

MonoGame examples and test projects
MIT License
0 stars 0 forks source link

IoC Container #10

Open EnsignPayton opened 6 years ago

EnsignPayton commented 6 years ago

Use an IoC container with single-instance support. This has numerous benefits:

  1. We don't have to change initialization code every time a constructor changes
  2. We don't have to use the Singleton pattern for accessing single instances of objects
  3. We don't have to manually pass objects around, they're given to classes automatically.

More info here: https://en.wikipedia.org/wiki/Inversion_of_control

I have the most experience with StructureMap, but I've heard that Autofac is a bit faster.

EnsignPayton commented 6 years ago

https://kevinholditch.co.uk/2012/07/09/xna-game-rotation-adding-autofac-ioc-container-part-11/