Difference between set_type_override_by_type and set_type_override_by_name

In reply to dave_59:

Hi Dave,

I have a large environment at TOP (envTOP) which instantiates two small environments (say envA, envB). envA and envB both try to override the same object (say abc_obj) in the build phase.

envA build phase:
set_type_override_by_type (abc_obj::get_type(), Atype::get_type(), 0);

envB build phase:
set_type_override_by_type (abc_obj::get_type(), Btype::get_type(), 0);

I want that at envTOP, abc_obj should NOT be overridden.
In the hierarchy envA and below, abc_obj should be overridden to Atype
In the hierarchy envB and below, abc_obj should be overridden to Btype

Any way to resolve this? Is the Env the best place to override ?

Many Thanks,