# Function New Constructor

**URL:** <https://verificationacademy.com/forums/t/function-new-constructor/46796>\
**Category:** UVM\
**Tags:** SystemVerilog, UVM\
**Created:** [April 10, 2024, 3:34am UTC](https://verificationacademy.com/forums/t/function-new-constructor/46796 "2024-04-10T03:34:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahesh\_6](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Mahesh\_6](https://verificationacademy.com/forums/u/Mahesh_6)\
**Post date:** [April 10, 2024, 3:34am UTC](https://verificationacademy.com/forums/t/function-new-constructor/46796/1 "2024-04-10T03:34:58Z")

</div>

HI All,

function new(string path = “some\_name”);  
super.new(path);  
endfunction

function new(string name= “some\_name”);  
super.new(name);  
endfunction

What are the difference between name and path based constructor?  
Generally I use name based constructor, what could be the use case of path?

According to my view: path based constructor can be used in factory instance override where user can mention exact path of the component to be replaced. Is this correct ?

Thank You,

---

<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:** [April 11, 2024, 4:28pm UTC](https://verificationacademy.com/forums/t/function-new-constructor/46796/2 "2024-04-11T16:28:31Z")

</div>

> [@Mahesh\_6](#):
>
> function new(string path

I do not remember any code in the UVM that has a path as the constructor’s first argument. You’ll have to show us where you’ve seen this.
