|visits||member for||1 year, 7 months|
|seen||Dec 9 '13 at 21:57|
Martin Fowler's Refactoring book: switch statement is using other object's data, why is that bad ? A deeper explanation is sought for.
It actually wants you to avoid switch statements based on data types. Each of those types should be an object, and the task should be performed by the each class instead. The class for new releases should give the charge for new release, etc. Keep the knowledge specific about a class in the class. By doing so, you can easily add new classes without having to alter logic in the class's users.