September 2008 Entries

Boxing / Unboxing and passing by 'ref'.

I recently heard a question stating something along the lines of: "What is Boxing?" My initial thoughts were the classic example using an ArrayList, whereby storing a value type (int etc) is 'boxed' into an object so the ArrayList can contain it. But the question was followed up with: "Ok, so is this how you think passing a value by ref to a method works?" Personally I hadn't thought about that, I've used 'ref' on numerous occasions, but hadn't really considered how the CLR does this.... So. How ......

Barcamp Brighton 3: Topic chosen

Due to overwhelming responses to my blog (all 2 of you :)) I'm definitely doing a workshop stylee thing on creating ControlTemplates for WPF Buttons in Expression Blend (2.5), and I have my powerpoint loveliness done for a small chat about SCC, in particular branching... I couldn't think of a way to put them together, SCC the WPF Way! sounded nifty, but just seemed too complicated to join together :) So maybe both? Is that allowed.. Gah, first time, we'll see! In terms of topics to see, I'm interested ......

Quick Serialization / Deserialization Helper Method

After discovering some pretty significant serializaton issues in the code base, and approximately 0% testing of the implementation of ISerializable, I've been spending the last couple of days writing tests for the serialization... I've been using the following code to do the serialization, easy to use: MyObject m = new MyObject("Test"); Assert.IsTrue( m.Equals( Serialization.SerializeAndD... m ) ) ); Of course, this uses the 'Serialization' class, which is defined below! using System.IO; ......