# Factory registration

**URL:** <https://verificationacademy.com/forums/t/factory-registration/31855>\
**Category:** UVM\
**Tags:** UVM, factory-registration\
**Created:** [May 24, 2016, 10:39am UTC](https://verificationacademy.com/forums/t/factory-registration/31855 "2016-05-24T10:39:51Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [May 29, 2016, 3:53pm UTC](https://verificationacademy.com/forums/t/factory-registration/31855/6 "2016-05-29T15:53:05Z")

</div>

_In reply to [ridip.mandal](https://verificationacademy.com/forums/t/factory-registration/31855/5):_  
There are no consequences for _registering_ a class definition with the factory other than it limits your constructor to having one argument (name) for classes derived from uvm\_object, and two arguments (name, parent) for classes derived from uvm\_component. There can be performance consequences for _creating_ class objects with the factory if you are going to be creating a lot of objects over time.

You should get in the habit of _registering_ all classes with the factory. You may not have a reason for overriding it now, but at some point, someone will want to do it and they can’t because you did not register it with the factory. An exception to this might be automatically generated classes, like a register model where you know it will not use the factory. An there can be a slight time 0 performance penalty for registration once you start getting into the 10s of thousands of class registrations.

My other suggestion is to get in the habit of always using the factory create() method instead of new() to construct any class derived from uvm\_component or uvm\_sequence\_item that is not defined inside the UVM base class library(uvm\_tlm\_fifo).

---

_[View the full topic](https://verificationacademy.com/forums/t/factory-registration/31855)._
