i gone through factory design pattern and got some doubt, 
 the code i have seen where in the `register` function,

they are storing the object in a `map` (*while registering, creating the objects first time and storing them in container class*), whenever we need the object we have to ask from the factory (`Factory::getObject("Rectangle")`), this rectangle is created and stored in the map already during registration, and this object they are returning whenever I am calling `getObject("Rectangle")`).

My doubt is every time I am getting same object only,
If I want to create 10 different objects for rectangle,

How can I create 10 diff objects of this rectangle?

Thanks in advanced.

```
RangeRingsFactory::RangeRingsFactory()
{
    Register("Big", &Picture::Create);            //picure & picyureInPicture inherited from IRangeRings 
    Register("Small", &PictureInPicture::Create);
}

RangeRingsFactory *RangeRingsFactory::Get()
{
    static RangeRingsFactory instance;
    return &instance;
}
void RangeRingsFactory::Register(const string &Name, CreateRRFn pfnCreate)
{
    map1[Name] = pfnCreate;
}

IRangeRings *RangeRingsFactory::CreateRR(const string &Name)
{
     FactoryMap::iterator it = map1.find(Name);
            if( it != map1.end() )
                   return it->second();
            return NULL;

}

```

picture :

```
Picture::Picture():IRangeRings()
{
    setRangeScale(QRect(-200,-200,400,400));
}
IRangeRings *Picture::Create()
{
    return new Picture();
}

```

main:

```
MainWindow::MainWindow(QWidget *parent)
: QWidget(parent)
{
    string Name1 = "Big";
    IRangeRings *p1 = RangeRingsFactory::Get()->CreateRR(Name1);
    string Name2 = "Small";
    IRangeRings *p2 = RangeRingsFactory::Get()->CreateRR(Name2);

    outerLayout = new QHBoxLayout;

    outerLayout->addWidget(p1);
    outerLayout->addWidget(p2);
    this->setLayout(this->outerLayout);
}

```