23.5.09

The Last Mile

How do you walk your software product through the wilderness of dumb users, dodgy machine builds and missing dependencies?

You want to reduce your support footprint and the dysfunction of dealing with false positives(i.e. it’s your software not my machine syndrome). If you have control of the deployment landscape then a standardised machine build and knowledgeable first line support come in handy. Otherwise online users forums and comprehensive user documentation will help share knowledge of work arounds, gotchas and technical Voodo. The last thing you want is for the development team to be constantly building patches to support all machines under the sun. Doing this robs the team of the precious time required to develop new features and enrich the product’s functionality.

Time and Tide and Software releases…

My team releases software every week regardless of the political landscape or inefficiencies of other departments. Ours is a disciplined and rigorous approach, we aim to be proactive and to keep the momentum forward, never backward. After all this is agile and we embrace the iterative and incremental nature of our game. To the gentlemen from the hydro-methodology this does not make sense. Surely you should only release when the business say so and when the business are ready for your release. If we did that then we would be constrained by the same inefficiencies that plague other teams. And that aint agile. So I suppose time and tide and software releases wait for no man.

2.5.09

Refactoring to a fluent configuration interface

The starting point was a configuration class that had the following definition:
public const decimal AdultFactor = 6;
public const decimal ChildrenFactor = 3;
public const decimal GasKwHMinEstThreshold = 4000;
:
These parameters are always used together in the context of a calculation for gas consumption. The client code uses these config values in the following fashion:

calculatedUsageKw = AdjustUsageForRadiators(calculatedUsageKw, GasConfiguration.AdultFactor,
                                            GasConfiguration.ChildrenFactor,
                                            GasConfiguration.RadiatorFactor,
                                            GasConfiguration.PersonsAtPropertyFactor);
I wanted to give the setting of the gas consumption parameters a fluid feel in the following style
public static IFluentConfiguration Create()
{
var fluentConfig = new GasConfigurationFluent();

fluentConfig.SetAdultFactor(6).SetChildrenFactor(3).
SetGasKwHMinEstThreshold(4000).SetGasPointsMinThreshold(12).
SetGasPointsToKwHConvFactor(400).SetGasWaterHeatingAmount(10).
SetHobGasCooker(4).SetMainRoomFireOnGas(16).
SetPersonsAtPropertyFactor(2).SetRadiatorFactor(5);

return fluentConfig;
}

The client code accessing the fluent configuration interface was refactored to:

private decimal? AdjustUsageForRadiators(decimal? calculatedUsageKw, IFluentConfiguration fluentConfig)

The GasConfigurationFluent has setters that take the folllowing general approach:
public IFluentConfiguration SetAdultFactor(decimal? adultFactor)
{
    AdultFactor = adultFactor;
    return this;
}
And yes my setters have a return value which is in effect the current context i.e. my fluent configuration.After applying this refactoring, a few things became apparent,
1. The method chaining enforces the fact that these parameters exist in the same context and somewhat provides a cohesive view of my configuration interface. The setting of the configuration values is much more concise.
2. The cohesive nature of this configuration hints at the fact that a DSL(Domain Specific Language) could possibly be built around the calculation of gas consumption.

1.5.09

Wide laps

If the benefits of having a wide sturdy lap were ever in question, then look no further. On the left is my company laptop firmly glued to my thigh. The other limb is supporting my XPS M1330; looking on in the background is the Inspiron 1525.