# Misnomer in the term "child class"

**URL:** <https://verificationacademy.com/forums/t/misnomer-in-the-term-child-class/32307>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, child-class\
**Created:** [September 26, 2016, 5:31am UTC](https://verificationacademy.com/forums/t/misnomer-in-the-term-child-class/32307 "2016-09-26T05:31:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reuben](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/reuben/32/1409_2.png) [@Reuben](https://verificationacademy.com/forums/u/Reuben)\
**Post date:** [September 26, 2016, 5:31am UTC](https://verificationacademy.com/forums/t/misnomer-in-the-term-child-class/32307/1 "2016-09-26T05:31:11Z")

</div>

I have read some articles and videos here in Verification Academy, and what I noticed is that there seems to be a misnomer regarding the term “child class”. According to other websites, a child class is also called a subclass which means that it is the derived or inherited class from a base/parent class. For example, in the code below, class C is a child class of class P, since the former is extended from class P:

```verilog

class P;

endclass : P

class C extends P;

endclass : C

```

However, some articles or videos here in Verification Academy also refers an instantiated class as a child class. Example:

```verilog

class A;

endclass : A

class P;

A A_h; // Should we treat an instantiated class as a child of class P?

endclass : P

```

So, should we treat an instantiated class as a child of the class where it was instantiated?  
Please correct me if I’m wrong.

Thanks.

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [September 26, 2016, 5:53am UTC](https://verificationacademy.com/forums/t/misnomer-in-the-term-child-class/32307/2 "2016-09-26T05:53:43Z")

</div>

_In reply to [Reuben](https://verificationacademy.com/forums/t/misnomer-in-the-term-child-class/32307):_  
The words **parent** and **child** are ad-hoc terminology. I recommend against using **parent** and **child** when referring to OOP inheritance. Parents create(construct) children and they are distinct objects from their parents. When you inherit property, that property becomes yours and all your property is part of one object.

The UVM uses 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.

---

<div class="post-metadata">

**Author:** ![renvill00](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/r/f9ae1b/32.png) [@renvill00](https://verificationacademy.com/forums/u/renvill00)\
**Post date:** [February 11, 2025, 8:51am UTC](https://verificationacademy.com/forums/t/misnomer-in-the-term-child-class/32307/3 "2025-02-11T08:51:44Z")

</div>

An ongoing SV/UVM study/research brought me here, sorry for reviving this 8-yr old thread 😊

I have a few follow-up questions :

1. For simpler discussions like this, it is way more easier for me (a non-OOP expert) to understand that `class A` is a parent and `class B` is a child that _inherits_ the properties of that parent (through the `extend` construct) and adds new properties for itself. Just like in the real world, a parent has black hair and so the child inherits the black hair plus other qualities/personalities that the parent doesn’t have.

Are there implications of using the terminologies _parent_ and _child_ in bigger/deeper/more technical discussions that’s why they should not be called as such?

1. I somehow understood Dave’s explanation as this :

```auto
class plantA;
   int flower;
endclass : plantA

class plantB extends plantA;
  int thorns;
enclass : plantB

class garden;
   plantA orchid;
   plantB cactus;

   function new();
      orchid = new();
      cactus = new();
   endfunction // # so children = orchid and cactus, then parent = garden??
endclass : garden

```

---

<div class="post-metadata">

**Author:** ![MichaelP](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@MichaelP](https://verificationacademy.com/forums/u/MichaelP)\
**Post date:** [February 11, 2025, 4:21pm UTC](https://verificationacademy.com/forums/t/misnomer-in-the-term-child-class/32307/4 "2025-02-11T16:21:10Z")

</div>

These terms of parent/child in UVM are not like in real life…  
It only helps to understand the hierarchical structure of the testbench, nothing more than that.

In OOP more accurate terms to use are:  
**Base** class  
**Derived** class  
As Dave stated, it is better not to use parent and child when referring to OOP inheritance.

In your example:  
_plantB_ is a **derived class** of _plantA_.

The class _garden_ contains the classes: _orchid_ and _cactus_,  
not even a parent…

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [February 11, 2025, 5:09pm UTC](https://verificationacademy.com/forums/t/misnomer-in-the-term-child-class/32307/5 "2025-02-11T17:09:52Z")

</div>

The example you show does not create parent/child relationships. There’s no way to traverse all the plants in the garden, or have a plant know which garden it belongs to. These are concepts that don’t require OOP (but can still take advantage of it).

I find that Object-Oriented Programming (OOP) requires a significant leap in education to master. Once you are over that leap, the terminology does not matter that much. But it helps others get over that leap.
