This is a discussion on polimorphic factory & constructor arguments within the Software Patterns forums, part of the Testing category; any one knows how to deal when you need a polimorphic factory but some sub-factories need some kind of ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
polimorphic factory & constructor arguments
any one knows how to deal when you need a
polimorphic factory but some sub-factories need some kind of constructor arguments?? (I mean in cases where product's default constructors doesn't make any sense). thanks a lot! hernan rancati (cesare) ps: i have some clue to solve the problem using a kind of generic composite argument (an interface) but doesn't convince me too much.. |
|
|||
|
Re: polimorphic factory & constructor arguments
> any one knows how to deal when you need a
> polimorphic factory but some sub-factories > need some kind of constructor arguments?? > (I mean in cases where product's default constructors > doesn't make any sense). How are the derived classes being determined and where would the parameters for the non-default constructors come from? Once that is known it will be easier to offer a suggestion. Presumably, the client code using the constructed objects knows nothing about the derived classes since it's only knows of the base class. |