Add getComponent method to the baseclass prototype