Entity Framework 4.1 Hooks – DRYing it up with EFHooks

Posted by Kevin McKelvin on June 21, 2011 in Entity Framework, Open Source

One of the things I fell in love with about Rails is its automatic management of timestamps on data.  When you create a new entity, it sets the created_at field.  When you Update it, it sets the modified_at timestamp.For a long time I’ve used NHibernate as my ORM of choice for .NET and registered listeners for the pre-insert and pre-update events in NHibernate to handle this for me.  Now that Entity Framework 4.1 is out and becoming more useful I was interested in seeing how similar things could be done.Entity Framework’s extension points are very limited compared to what NHiber

Continue ReadingView Comments (2)

Android vs WP7

Posted by Kevin McKelvin on June 16, 2011 in Hardware

A couple of months ago I blogged about my experiences with WP7 on the HTC Trophy. Well soon after that I sat playing with Android 2.3.3 and began seeing holes in WP7 that I didn’t even know were there before. The first point is location based, Google has got far more market penetration here in South Africa than bing has.  In preparation for the Soccer world cup last year, Google beefed up their maps of South Africa including Street View, local business references, their geolocation quality and their routing engines.  If I type something like “Roman’s Pizza” into my droid de

Continue ReadingView Comments (4)

Getting Started with TypeMock Isolator (in VS2010)

Posted by Kevin McKelvin on June 14, 2011 in Testing

I started playing with TypeMock Isolator this morning as an alternative to using the Moles framework from Microsoft Research. Isolation frameworks allow you to intercept and redirect calls made to concrete call sites and replace them with a delegate.  If that sounds like a bit of gibberish consider this scenario: If you have a class that makes a call to DateTime.Now to check against an expiry date and you want to test that it expires on a future date, you need to control what the static DateTime.Now returns.  That’s where an isolator comes in. To get started with TypeMock, once

Continue ReadingView Comments (2)

Unit Testing & Mocking Presentation (ERDDUG June 2011)

Posted by Kevin McKelvin on June 13, 2011 in Practices, Speaking

On Saturday I gave a presentation at ERDDUG on Unit Testing, Mocking and basics of TDD. Slides are on Slideshare: Unit testing Also here’s the sound recording of the presentation. Thanks to Misko Hevery for the diagrams I used in those slides to illustrate class dependencies.  If you’re interested in some more detailed stuff, he has an excellent talk in the Google Tech Talks on designing for testability, here:

Continue ReadingLeave a Comment