I'm looking for an example that will help me through the following (expressed in generic OO terms):
Consider an abstract base class B, and derived classes D1 and D2. I'd like to have factory that instantiates the correct object type (D1 or D2) based on some input argument (Assume the class names are based on the argument. In this example, the argument would be 1 or 2). Thanks.
In reply to Factory Pattern for Class Heirarchy by dcorbin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |