Menu

Murder Your Darlings

July 07, 2010

Lately I’ve been working on connectivity with NASDAQ. The protocols involve parsing fixed-offset messages of various types. We’re not doing high frequency trading so we are optimizing for programmer efficiency — that is, the API I expose to the rest of the system should make sense, so I’m representing the different types of messages, trading… Read more

Mimicking Abstract Classes with Objective-C

July 03, 2010

Objective-C doesn’t have the abstract class construct. The common approach to mimic it is to use NSObject’s doesNotRecognizeSelector: @interface ShapeBase : NSObject {} – (void)draw { [self doesNotRecognizeSelector:_cmd]; } @end @interface Circle : ShapeBase {} // missing draw method @end This forces subclasses to override, otherwise you get a runtime exception. There’s also another approach… Read more