views:

35

answers:

0

I have a some type hierarchy: type A, type B contains field of type A array, type C contains field of type B...

(added: I mean type structure, not classes!)

I can't use classes by performance reason: type objects copying and creating more fast than the same for classes.

But now I need substitute lowest type and than use both types, old and new. So, it requires some copy-paste, How I can reduce that?

If I had java I would have introduce a interface for lowest type, but in this situation I have to create new type NA, new type NB, which almost coincide with B except field of type NA array, new type NC, which almost coincide with C, except field of type NB.

therefore I need to rewrite all function signatures....

I try to use "variant" declaration instead of precise declaration but it entails compilation errors and problems with construction the same as

Dim a as A
a=b 'It is forbidden if b as Variant even really b has the type A