# How to use typedef for a parameterized class

**URL:** <https://verificationacademy.com/forums/t/how-to-use-typedef-for-a-parameterized-class/34659>\
**Category:** UVM\
**Tags:** UVM\
**Created:** [July 9, 2018, 7:20pm UTC](https://verificationacademy.com/forums/t/how-to-use-typedef-for-a-parameterized-class/34659 "2018-07-09T19:20:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoshiko](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/y/8edcca/32.png) [@yoshiko](https://verificationacademy.com/forums/u/yoshiko)\
**Post date:** [July 9, 2018, 7:20pm UTC](https://verificationacademy.com/forums/t/how-to-use-typedef-for-a-parameterized-class/34659/1 "2018-07-09T19:20:52Z")

</div>

I am creating a class with parameters.  
now when I am taking object of this class in to other every time I have to do the same parameter passing again and again. Is there any way using like typedef etc using which I can create this .  
class cfg#(no of parameters)  
…  
end class  
class cfg\_seq

cfg #(no of parameters) obj1;

cfg #(no of parameters) obj2;(how to use typedef)

end class

---

<div class="post-metadata">

**Author:** ![chr\_sue](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/chr_sue/32/1199_2.png) [@chr\_sue](https://verificationacademy.com/forums/u/chr_sue)\
**Post date:** [July 9, 2018, 8:14pm UTC](https://verificationacademy.com/forums/t/how-to-use-typedef-for-a-parameterized-class/34659/2 "2018-07-09T20:14:16Z")

</div>

_In reply to [yoshiko](https://verificationacademy.com/forums/t/how-to-use-typedef-for-a-parameterized-class/34659):_

A class can be considered as a data type like this

```verilog
typedef class cfg #(no_of_parameters) cfg_t;

```

In any place you can now use the type class\_t instead of the parameterized class.  
BTW this is the prefered way dealing with parameterized classes.
