If I modified base class, how can I know that which derived classes are affected. To elaborate more, for example, I have two base classes named Class A and Class B. I have Class X and Class Y inheriting from Class A, and Class Z inherits from Class B. Here in this case scenario, I have only 2 base class and 3 derived classes and it is manageable to see how they are interrelated. What if I have so many derived classes with so many base classes in real world enterprise application. How can I identify which classes are going to affect when I change base class. Thank.
Asked
Active
Viewed 134 times
1
-
Via your documentation and class diagrams? Or do you mean via code? – cjb110 Jul 21 '15 at 07:14
-
http://stackoverflow.com/questions/282377/visual-studio-how-do-i-show-all-classes-inherited-from-a-base-class – Matteo Umili Jul 21 '15 at 07:17
-
@cjb110 I agree that class diagrams is one way to go. Is is possible by code to look up? – jkhaung Jul 21 '15 at 07:22
1 Answers
1
In Visual Studio you would right click on the thing you want to change and in the popup menu select either View all references
or View call hierarchy
.
If you want to do it yourself in code you would use reflection
for example as described in Discovering derived types using reflection.