|
Factory Pattern Concept :
Methodologies like OVM and VMM make heavy use of the factory concept. The factory method pattern is an object-oriented design pattern. Like other creational patterns, it deals with the problem of creating objects (products) without specifying the exact class of object that will be created. The factory method design pattern handles this problem by defining a separate method for creating the objects, whose subclasses can then override to specify the derived type of product that will be created. More generally, the term factory method is often used to refer to any method whose main purpose is creation of objects.
Or in simple terms factory pattern help in creation of the object when you dont know the exact type of the object. the normal way of creating the object is :
// Normal Type based object creation
// Class object
class my_class;
int i;
endclass
program main;
// Create object type my_class
my_class obj1;
obj1 = new
endprogram
// Using Factory I should be able to do the following
program main;
base_class my_class_object;
base_class = factory.create_object("my_class"); // See here the type of the object to be created is passed as a string so we dont know the exact type of the object
endprogram
//Now lets see how it works in system verilog example : TO BE ADDED
|
| Keywords :
Factory
Pattern
|
|
This Articles is written/submitted by puneet (Puneet Aggarwal). You can also contribute to Asicguru.com. Click here to start
|
Prev << What is callback
|
Next >> Logic Reg wire
|