Hi,
> As for the explosion of classes, that worries me too.
> Our system can potentially generate hundreds, if not
> thousands, of classes this way. Therefore, I have put
> in a threshold value so that we use reflection for a
> given Method/Field until the threshold is crossed, and
> then we generate the byte code to speed up those hot
> spots.
you could of course optimize everything into a single class
and use instanceof or the in your case sufficient (?) and
more performant way:
if(obj.getClass() == A.class) {
} else if() ...
Of course you would need to know all classes that apply
in advance ...
Cheers
Markus