Re: abstract factory -- a doubt ?




Phlip wrote:
Duplication. Without the factory, then there are lots of 'new' statements
scattered around, and sometimes there are more 'if' statements that detect
a type code. The factory converts type codes to real types, in one place,
and this lets client code use the types without so many 'if' statements.

okay , makes sense. could you elaborate a bit more as to what "converts
type codes to real types" mean (maybe with an example) ? Also , somehow
it seems like that the complexity is transffered ( though now invisible
to the client ) ?

.



Relevant Pages

  • Re: abstract factory -- a doubt ?
    ... The factory converts type codes to real types, ... and this lets client code use the types without so many 'if' ... into internal types with virtual methods. ...
    (comp.object)
  • Re: abstract factory -- a doubt ?
    ... The factory converts type codes to real types, in one place, ... and this lets client code use the types without so many 'if' statements. ...
    (comp.object)