Reference: Modern C++ Design by Andrei Alexandrescu. Addison-Wesley, 2001, p. 54.
Many times when you see switching on types, it indicates a non-object-oriented design. Some of the places where it is usually okay are:
1) when unmarshalling data from across a wire; and | |
2) when implementing a virtual constructor |
No comments:
Post a Comment