Inheritance and nesting notation of classes in UVM

Normally, in OOL there are two kinds of clear notations.

First, for
See Inheritance on Wikipedia for more information.
Class Inheritance relations
○ Father/Parent/base class → class A;
○ Child/sub/derived class → class B extends A;

Second,
See Nested classes (not supported in all languages)
Class Hierarchy relations/NESTED CLASSES
○ Wrapper/enclosing/Outer Class /master Class → class B; A instance_A; endclass;
○ Instanced/member/nested/inner/serve Class → class A;
You can create the sub instanced class doing “new” inside the inner class or you can assign a handler from outside to a inner member of a class, as showed below.


class topclass;      
     A  top_Ainst= new(); 
     B  wrapperclass=new();     
     wrapperclass.instance_A=top_Ainst;    //here, an outer class  called wrapperclass is assigned (a member) with another class (inner class in respect to the wrapperclass), both classes are created in a supertop class    
endclass;

The previous picture showed that we can’t have an inner class instanced in the “heap”. This is allowed in systemverilog. This picture example is for java and ilustration purposed.

In UVM i have realized that it seems there is a mixture of parent<->child notation with outer<->inner class notation in constructors of UVM components.
e.g. using new of the UVM components


function new(name,parent);//provide a "name" and a "parent". The "parent" is, in fact, the outer/wrapper class of this class, for this component
     super.new(name, parent);   //super here generates inheritance base class recursively for the same outerclass. 
     //"Super" is an inheritance operation and has nothing to do with the handler provided with "parent" which is used to pass the hierarchy to base class.
     // UVM components needs the outerclass in the new constructor and not a father inheritance handler.  
endfunction;

Components in UVM use “name”,“parent” inputs in the constructors and they are used/assigned each time the UVM “create method” is called.
The “super” keyword is used from within a derived class to refer to properties of the base class (inheritance) of the current class. The term “parent” in the new function is confusing because it has nothing to do with inheritance. Is it correct? or did i miss something?

The question is:
would it be not a better and proper notation to call in UVM these inputs again with “name” and the “outerclasshandle” (“parent” is a inheritance and in my opinion wrong notation used in UVM)?

I am looking forward your opinion and answers to see if my view is wrong.

In reply to Jonathan_Alvarez:
I disagree with the terms parent and child when referring to OOP inheritance. Parents create(construct) children and they are distinct objects. When you inherit property, that property becomes yours and all your property is part of one object.

The UVM use terms parent and child to refer to relationships between objects when build a hierarchical tree/graph structure. The class uvm_component has a handle to its parent and handles to all its children so that you can traverse the hierarchical structure. This terminology is used in most programming languages and is independent of OOP.

You can create a hierarchical structure without nesting classes. In fact you can build a structure with just a single class type. Nesting of class definitions hides the name of a class within another class so that only the outer-class object can construct the inner class object.

In reply to dave_59:

Just to be sure. You say that “parent” and “child” should not be used to describe inheritance relations between classes but for hierarchical tree structures.
What do you suggest for inheritance relations? base class and derived/sub class terminology?

The parent-child and base-derived terminology is something that many mix and terminology is important to advance without confusion. As an example, in wikipedia article they use both terms.

Thanks for you answer.

In reply to Jonathan_Alvarez:
I would use baseextended or supersubclass.

OOP also uses the terminology IS-A to describe inheritance relationships, and HAS-A to describe composition relationships. A Honda Civic IS-A Passenger Car which IS-A Motor Vehicle. But not all Passenger Cars are Honda Civics. A Passenger Car HAS-A set of tires. That set of tires can be used on many different cars.