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 »

New blog up and running

I've finally got my new blog finished and uploaded, and here it is. Actually, once I had finished my personal blog, this one was just a case of altering the stylesheet and adding some bells and whistles, and I was good to go.

I've dumped Wordpress in favour of a custom implementation; I didn't need all the gubbins that Wordpress provided and since the advent of Linq and Linq To Sql I was able to find the time to complete such a project to my satisfaction. This time around, I'm using .Net 3.5, Linq To Sql and Sql Server and a whole lot of custom code.

These two sites make use of the UrlRewriter.Net library, which is a must-have bit of code. I also employ this neat trick of storing the Asp.Net viewstate on the server, which can reduce the page size considerably.

I also created a base library for all my L2SQL data context needs, and I'll be writing about that shortly. I used it as a base for all my middle-tier data entity 'managers' to provide some uniformity when querying data, and also to manage the persistance of the data context.

One thing left to implement is pingbacks, which should be useful should anyone feel the need to link to my site. It would make an interesting project though.