Imagine that I have a document (Word document).
I have an enumeration that will indicate how to extract data from a document. Therefore, if I need only text, images, or both (3 members of the enumeration).
I have a case statement based on this listing, but without falling into the smell of code, how can I write code that doesn't repeat too much? For each condition in the switch, should I have a separate method (the easiest way) or a method that takes a parameter (for example, an enumeration value), and then use if instructions if (xyz) execute abc, and therefore on.
Or is there a faster and more efficient way?
source share