Introduction to OOP Chapter 25: Reflection and Introspection : next previous audio real text

Testing if an Object is an Instance of a Class

We have seen already that most languages provide a way to test if an object is an instance of a class
	if Member(aVariable, Child) then
		aChild = Child(aVariable)   (* Object Pascal *)
This is needed for downcasting.

However, if you find yourself using this a lot, then you aren't thinking in an object-oriented way, since often such situations can be better written using polymorphism.

Intro OOP, Chapter 25, Slide 05