Hire me at Go Tripod.

Ayende quickly posted something called HotSwap, which is a little snippet of code which uses a FileWatcher, Windsor, and on-the-fly code recompilation to increase your productivity. With ASP.NET, building your code changes causes an appdomain restart, and you will typically have to wait a few seconds for the appdomain to come back up before the browser will display your changes. This basically means that when working with ASP.NET, there are no quick code changes – you always have that four second wait till you see the effects.

HotSwap resolves this by building your code for you when it detects a change. Using Windsor it can swap out the old assembly containing your code and replace it with a new dynamically created assembly containing your new code – all automatically. The key advantage of this is that it’s all done in-memory, and none of the DLL files in the bin directory change. This means that you won’t trigger an appdomain restart and your changes can be seen almost instantly!

I was really impressed and excited by this approach so I did a very quick screencast on the topic. I was using the Castle RC3 MSI, and created a project with Windsor integration enabled. This code only works for your controllers at the moment, but a lot of the time that’ll be where you need this kind of productivity boost.

Ayende – cheers for this, and I’m sorry if I pronounced your name wrong as I’ve only seen it written down!

UPDATE: I’ve uploaded the HotswapTest Project from the screencast. You’ll probably need the Castle RC3 MSI installed to build it.

Castle Project RC3 Released

September 21st 2007, 12:59 am in .NET, C#, Castle.

Hammett reports that Castle RC3 is now available. There are loads and loads of changes in this, new Controller test stuff, JSON support, new validation on the server and client – it’s a great release. Get Castle RC3 now.

I’ve updated Phone2Flickr to 0.2, which while still very much an unstable product is a lot more useful than the earlier 0.1 release. I’ve added a wizard-style preferences screen which guides users through the steps needed to set the program up with their device. More importantly I’ve back-ported Phone2Flickr to .NET 2.0 which opens it up to a whole load more users.

Remind me – what does Phone2Flickr do?

Leave it running in the background and Phone2Flickr will grab photos from your phone when you come into range, and then send those photos up to your Flickr account. You need a Bluetooth enabled device which supports the Obex file browsing service; most new phones will.

Downloading and Contributing

Phone2Flickr 0.2 can be downloaded here. Thanks to Sean Chambers for encouraging the development of the new release!

I’ve been interested in using the Repository pattern in an application for a while now; same goes for Windsor. When prototyping with repositories it became clear that I could use them together in a fairly simple way which would serve as a good introduction to both.

(more…)

Cameras on mobile phones have reached such a ridiculous level of technology that you can get decent shots from them, decent enough that you’d actually want to keep. I was flicking through the ones I had stored on my Samsung d900 and realised there were a fair few I didn’t want to risk losing in a phone “incident”, and so I went exploring for a technical solution…

(more…)

Using Delegates in Refactoring

May 29th 2007, 1:13 pm in .NET, C#, JSON.

I’m doing some work on a .NET 1.1 application right now, and I have a situation where I have very similar code being repeated in a number of different classes. The code does paging of a collection, which is then rendered as JSON; it’s not complex code but it did take me a few goes to get right, and so rather than copying and pasting it all over the place I refactored it so the core functionality was only written once. In order to do that, I used delegates. (more…)

I’ve been using libraries such as NewtonSoft’s JSON.NET or AjaxPro to serialize a class to JSON. There’s something about my approach which didn’t really sit too well, and C# 3 has an elegant solution.
(more…)

When creating Wiretap, I needed to be able to sort a collection of Wiretap Servers in C# code. There’s nothing wrong with the way I ended up doing, but it never sat very well with me. Using anonymous delegates, which are provided in C# 2.0, I can remove this niggling code smell. (more…)

Jetbrains have announced that Resharper is moving to a new evaluation model which will make it easier to try out their outstanding Visual Studio extension. Previously, if you wanted to test Resharper you’d have to download it then request an evaluation license. But now you can simply download, install, and enjoy 30 days of developing pleasure.

Resharper includes improved Intellisense, refactoring options, better error highlighting, reformatting options, code generation, and lots more features guaranteed to put a smile on the face of any developer. If you’ve never tried it, I urge you to get along to the Jetbrains site and download Resharper.

This screencast takes a break from the theme of the past few in the series and examines two of the projects within Castle’s Contrib project – CodeGenerator and ActiveWriter.

http://colinramsay.co.uk/screencasts/5/

The Monday morning blues mean this cast is a little less fluent than the others, but I hope you find it useful. Read on for some of the code snippets used in the screencast. (more…)

« Previous Entries

Next Entries »