Today I refactored some code that has been bugging me for a while, and wanted to share the results. The change resulted in a substantial code reduction and what I felt was a more elegant solution.
The code that I was looking at had a whole suite of objects that all implemented a proprietary ITransactionHandler interface, with methods such as Process(), and properties such as TransactionType and TransactionName. It was the latter two that made for some very verbose and awkward code. I found this basic pattern repeated in each class, and there were some 40 of these:
public class...