Theme by nostrich (modified).

15 12 2010

By Steve Mason

Properly mapping read-only collections in NHibernate

A common (and highly recommended) pattern when mapping collections in NHibernate is to only expose a read-only version of your collections on the object, then provide granular methods for interacting with that collection, like this pseudo-code:

public class MyEntity : Entity // provides ID etc
{
   
public IEnumerable<MyChild> Children;
   
public void AddChild(MyChild child);
   
public void RemoveChild(MyChild child);
}

Read more...

24 10 2010

By Steve Mason

Automating My Home - Part 1 - The Intro

I've always had a part-time obsession with automating my home. I remember in DT class when I was 14 my project was a prototype for a house with automated lighting - move a model person from room to room in the little balsa-wood model of a house I made and the lights went on and off!


Read more...

23 09 2010

By Steve Mason

What's wrong with this JavaScript

I've been doing a bit of hacking on a nodejs project recently, and this problem left me scratching my head for a while.


Read more...

17 09 2010

By Steve Mason

Installing nodejs on cygwin using nvm

Previously, I showed you how to setup node.js on Ubuntu, and hopefully OSX at the same time.

I recently needed to do some hacking on this blog on Windows, so I needed to install node on my Windows machine. Historically this hasn't been very straightforward, but using cygwin it's now possible, and even fairly easy to achieve. Don't expect *nix-like performance though, a lot of the APIs that make node so fast run a lot slower when they have to pass through cygwin's libraries.


Read more...

06 09 2010

By Steve Mason

How to "Publish to filesystem" in msbuild

Despite all the hype around MSDeploy in .NET 4 / VS2010, it doesn't exactly make it easy to do a traditional "Publish to filesystem" from the commandline.


Read more...

11 08 2010

By Steve Mason

Setting up Node.Js

I've been looking a lot at node.js recently. Being JavaScript I can apply my knowledge of the language, and start to stretch it, but being server-side and platform independant I can also start to play around with Linux and other shiny things that aren't .NET.

This post is the first in a collection on how I've migrated this blog, previously hosted on Tumblr, to be hosted on a virtual Rackspace Cloud server running Node and the Wheat blogging platform.

These instructions are specifically for the latest Ubuntu release, but I have done similar on OSX. Node isn't known to run spectacularly well on Windows mind you.


Read more...

19 01 2010

By Steve Mason

Why ASP.NET MVC 2 is Broken

NOTE: I'm happy to say that the majority of these issues are fixed in the ASP.NET MVC 2 RTW release. I've now been using the framework in a production app for a number of months and am very happy with it - kudos to the ASP.NET MVC team for listening to community feedback! I'm keeping this post here for posterity.

I'm a big fan of the ASP.NET MVC framework. I've been using it at work since early 2008 (around preview 2) so I've become quite used to it. I particularly like that the extension points that have been opened up allow you to mould the framework to the way you want to work, rather than the other way around (*cough** WebForms *cough*).

ASP.NET MVC 2 has been out in Preview and Beta form for a while now. In fact the Release Candidate has recently been released, which means the full 'RTW' release is just around the corner. Which is a pity.

It's a pity because out of all of the new features of ASP.NET MVC 2 none of them are well-baked enough for me to justify upgrading to (yet I'll probably be have to). Why? Let me show you, one feature at a time.
Read more...