T
Todor Todorov
I need a factory that produces items, and the items need to know about their
factory. Something like:
class Factory
{
Item GetNewItem();
}
class Item
{
Factory GetFactory();
}
Now, I would like to add some generics to the catory:
class Factory<TItem>
where TItem:Item
{
TItem GetNewItem();
}
class Item
{
Factory GetFactory();
}
Unfortunately, the Factory GetFactory() method now requries a generic type
and things won't work. Any siggestion how to fix that?
factory. Something like:
class Factory
{
Item GetNewItem();
}
class Item
{
Factory GetFactory();
}
Now, I would like to add some generics to the catory:
class Factory<TItem>
where TItem:Item
{
TItem GetNewItem();
}
class Item
{
Factory GetFactory();
}
Unfortunately, the Factory GetFactory() method now requries a generic type
and things won't work. Any siggestion how to fix that?