Jason Mitchell

Archive for January, 2012

Getting Started With Fluent NHibernate and Auto Mapping in C#

I always hear good things about NHibernate and how it is better than alternatives such as Entity Framework so I decided to try it out for myself; not being a fan of large XML configuration files I went the route of using Fluent NHibernate which provides a fluent interface for configuration purposes.  Even though I’ve recently [...]

XNA and C#: Calling DateTime.Now is Expensive

While working on a new game engine using XNA I decided to run Visual Studios profiling tools against a basic demo game to measure CPU usage.  The results showed that the update process used approximately 65% of the CPU time while the render process used roughly 25%.  This ratio was not what I had expected [...]

Data Access Using a Generic Repository in C#

The repository pattern is an abstraction layer which provides a well-organised approach to maintaining a separation between an applications data access and business logic layers.  This gives us the important advantages of making code more maintainable and readable and improving the testability of our code.  It also works great with dependency injection! When I started [...]