What’s wrong with the simple approach?
Nothing is wrong with it
It can be made to work
But it does have disadvantages
Adding a new type entails changing all the switch statements
Layout compatibility comes about only through convention
The code to deal with Circles is scattered all over the place
Previous slide
Next slide
Back to first slide
View graphic version