EXtending a class defines a new class which is of the same type as the base class.
Override you can use only if you have a second class of the same type as you want to override.
In other words: extending a class is necessary for using the override.
It depends on whether the base class was ever intended to be used alone, or does it have to be extended to be useful. uvm_object and uvm_component are declared as virtual classes and can never be constructed directly. But unfortunately, you can’t declare a base class as virtual and still register it with the factory (this might be fixed in an upcoming version of the UVM).
So if you are going to have multiple extensions from the base class and want to be able to switch between different extensions, you need to create the base class and then override it.
In reply to dharamvir:
The difference depends on what you have put in the extended class. If you have only overrides of virtual methods and constraints, there is no difference. But if you add more class members and methods, you cannot access extended class members from a base class variable. That is the case if create() a base class object and override the factory type.
BTW, registering a virtual class with the factory seems to be a tool dependent “feature”. That is because some tools allow you to compile code that have calls to the constructor of a virtual class, but error at runtime if you actually do.