Monthly Archive: September 2010

Sep
30
2010

Code Better: Reference Containers for Change-Resistant Constructors

Proponents of dependency injection try to design classes so they can either work autonomously or get all services they rely on handed to them through their constructor. But even without dependency injection, the situation often arises where certain classes need to interact with a lot of other objects. In these cases, you often end up …

Continue reading »

Sep
15
2010

Code Better: Booleans instead of Comments

There are lots of small tricks a programmer learns over time. With this post, I’m starting a little column called Code Better in which I’ll share some of my own tricks! If you want to show off some useful tricks of your own, I’d be happy to publish them here, too The first trick is …

Continue reading »

Sep
13
2010

MVC in Games

UML diagram of the monolithic design approach to IslandWar
In the game I’m currently working on, it appears that I’m slowly drifting towards a design that’s a close resemblance of the Model-View-Controller (MVC) pattern, despite originally rejecting the idea because I believed it would require my game world to expose too much of its internal data just so the view could keep track of …

Continue reading »

Sep
02
2010

Input Mocking in XNA

UML diagram of the design for the Nuclex Input library
I have updated my input library to a level where I think I can release it into the Nuclex Framework now. The design was tailored to make the input manager mockable (replaceable with a dummy object for unit testing), but the effort of mocking the entire input manager (versus just one input device) on an …

Continue reading »

Social Widgets powered by AB-WebLog.com.