New host at Poundhost

I've just moved this site over to a VPS hosted by Poundhost.com, which was both surprisingly cheap and good value for money. Now I get to completely control my hosting environment on my own Windows Server 2008 R2 box with IIS7, instead of letting some other company do it with certain restrictions.

I only found out about them really from a tweet which was re-tweeted by Scott Guthrie this week, and would encourage anyone thinking about getting a VPS to have a look at these guys.

Cheers Poundhost!

New WCF article over at CodeProject.com

Finally I found I had something to write about; an article on creating a remote file store using WCF, and it's hosted right now over at CodeProject.com. It basically shows you how to create a service-based remote file repository using the Windows Communication Foundation, which has been part of the .Net Framework since version 3.0.

Enjoy the article!

Simple object conversion pattern

Here's a quick conversion pattern you can use if you've got a lot of object conversion going on within your project, especially where databases and web services are involved. Bear in mind that this is essentially what the adapter pattern handles, but doesn't involve any sort of inheritence. It's like a cruder version of that pattern. It's also not as quick to use as a simple linq projection. However, you might want to do that tranposition more than once, so you'd want to stick that logic into a utility method or something similar.

This approach just formalises that utility method and enables you to keep all these kinds of conversions in one place; under one roof, if you will.

My solution involves an interface and (optionally) a utility method. It's handy for when you've got a set of data objects that you want to easily transpose and modify in order to send through a web service call to a client. Even if Linq To Sql (for example) does support such serialisation with WCF services without having to do much work, this often isn't desirable as generally you, as the programmer, want more control over exactly which data is sent across the wire. You might want to do this to guarantee packet sizes, for example, not to mention keeping the interface intact since your domain objects will change.

Read more »