How and why to design APIs that allow subclassing