March, 2009

Class Diagrams as Documentation

customer.png
customer.png

The Class Diagram tooling built into Visual Studio is worth its weight in gold as documentation.

What I didn't know, and discovered today, is that using Copy Image populates the clipboard with not only a raster version of the image, but a vector version as well. Fantastic for embedding into Word documents when writing documentation.

When to use Var

I had an interesting conversation with a friend earlier this week, over when to use the var keyword in C# 3.0.

He and a colleague had divergent views, one passionately arguing it should be used whenever possible, and the other just as passionate in his view that it should never be used.

Stages of Competence

Well over 10 years ago I learned of the so called Four stages of competence.

In short, these four stages identify the progression of skill adoption:

Someone with Unconscious Incompetence doesn't even know that they don't know.

Someone who is Consciously Incompetent has some idea of what he doesn't know.

Someone who is Consciously Competent can get the job done, but has to work at it.

Unscary Code

I found a better approach, one that isn't as scary ...

builder.Define(
    mEntryColumn,
    aEditor,
    (column, editor) => column.AddNumericField(editor.Format)
                            .BoundTo(editor, e => e.Value)
                            .FocusBoundTo(editor, e => e.Focused));

Scary Code

wtf.png

I just wrote this code:

builder.Define(
    mEntryColumn,
    aEditor,
    (column, editor) => column.AddNumericField(editor.Format)
                            .BoundTo(editor, e => e.Value)
                            .FocusWhen<ResponseEditor, EventArgs>(
                                editor, 
                                (e, handler) => e.Focussed += handler));

FocusWhen() is designed to hook up a UI Control (just created by the call to AddNumericField()) with a domain object (aEditor) so that aEditor can make the control focused.

Real World Information Modelling: Naming

Despite the growing maturity of our industry, there are some mistakes that seem to be repeated by each new generation of developers.

We have good technical standards for how we document our information structure – from good old Entity-Relationship diagrams through to the UML. There are even some attempts to provide general guidance on information modelling – the Nebulon Archetypes aka Colour Modelling are one good example – but in too many ways the lessons learnt by one generation of modellers are left for the next to learn anew.

The word "Estimate"

It’s interesting how the word estimate gets thrown around.

Easier Enums

Here's a slightly easier way to work with flag enumerations.

The Butler Did It

While reading a recent post by Jeff Attwood, entitled “Paying down your Technical Debt”, I came to the realisation that the causes of the death of Compudigm weren’t the ones I thought.

There are probably a thousand theories about what caused Compudigms eventual demise – there’s probably evidence for many of them.