Skip navigation.
Home

Editor's Choice on CodeProject.com

My article on Refactoring to the Template Method Design Pattern has been selected as the Editor's Choice on CodeProject.com. Thanks to them for that.

See Here

Refactoring to Dependency Injection

The second article on Refactoring to Design Patterns is now available on CodeProject.com. It's a continuation of the previous article, but takes things a step further. In the second article we extract an algorithm into it's own class so that we can use the Strategy and Dependency Injection Patterns.

Refactoring to the Template Design Pattern

The first of a two part article on refactoring to Design Patterns is now available on codeproject.com. The first article takes you from a single routine that is doing too much and shows the problems with trying to maintain it.

It then shows how to rector the code to the Template Method design pattern and demonstrates how new features can be added to the code while improving rather than degrading the quality of the code.

The sample code is in C#

Part two is coming soon and will take things a step further by introducing the Dependency Injection pattern.

Iterate over Enum Members

When you are dealing with a variable that can have one of a defined set of values, it is preferable to use an Enum to define those values, rather than use a primitive datatype like Integer.

This tip isn't about why Enums are better, it is about how to iterate over the range of valid values for the Enum. For example, given the following Enum:

    Private Enum FileOperation
        Open = 1
        Close = 2
        Save = 3
        SaveAs = 4
        Copy = 5
        Move = 6
        Delete = 7
    End Enum

Subversion Permissions

WARNING
This tip involves editing your Subversion repository .access file.
If your repository is hosted with Dreamhost there is a problem with this.

Whenever you use the Dreamhost Panel to create a new user it will wipe your
work from the .access file, and overwrite it with a default file that gives full
permission to everyone.

If you need to edit your .access file then keep a backup so that when you create new
users you can restore your version of the file.

Subversion Per Directory Access

The Specification Design Pattern

I've written a four part series on the Specification Design pattern. The four articles are available now on codeproject.com. The articles take you from an introduction to the pattern to a simple VB.Net implementation and finaly to a reusable Specification class that uses inheritence, generics and Operator Overloading.

Attributes and Value Objects article on eggheadcafe

My article on modelling attributes using value objects is available on eggheadcafe. It'll take you though the process of modelling a Temperature attribute, starting with a naive implementation and working towards a fully fledged value object.

See Here

VB6 Collections Article

This is another old article, but it may be useful to someone. It originally appeared in The Visual Basic Programmer's Journal, July 2001, Volume 11, Issue 7.

See Here

Visitor Design Pattern Article

This is going back a bit, but my article on the Visitor Design Pattern (in VB6) is available on MSDN. It was originally published in The Visual Basic Programmer's Journal, March 2001, Volume 11, Issue 3.
See Here

Syndicate content