September 23rd 2007, 12:08 pm in .NET, Agile Development, C#, Castle, Monorail, Screencasts, Windsor.
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!
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.
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…
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…)
April 23rd 2007, 10:47 pm in C#, Refactoring, Wiretap.
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…)
April 23rd 2007, 8:52 pm in .NET, Agile Development, C#, Visual Studio.
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.
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…)