Synopsis: | Selection statements (if-else and switch ) should be used when the control flow depends on an object's value; dynamic binding should be used when the control flow depends on the object's type |
Language: | C# |
Severity Level: | 9 |
Category: | Object oriented |
Description: |
This is a general OO principle. Please note that it is usually a design error to write a selection statement that queries the type of an object (keywords Exception: Using a selection statement to determine if some object implements one or more optional interfaces is a valid construct though. |