Exforsys
+ Reply to Thread
Results 1 to 2 of 2

polimorphic factory & constructor arguments

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 constructor ...

  1. #1
    hernan rancati Guest

    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..



  2. #2
    James Rafter Guest

    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.




Latest Article

Network Security Risk Assessment and Measurement

Read More...