Using the visitor pattern by adding categories to existing Objective-C class hierarchies.