Re: Abstract Method w/o Factory

From: Daniel T. (postmaster_at_earthlink.net)
Date: 10/19/03


Date: Sun, 19 Oct 2003 06:58:35 GMT

stocksb@ieee.org (Benjamin M. Stocks) wrote:

> > How does GetInstance know which derived class to instantiate? [My C++
> > is rusty but I don't see how GetInstance can be invoked without a
> > specific instance of [Base] in hand (unless it is a static method).]
> >
>
> GetInstance would have to be a static method that applies the well
> defined logic (it reads from an EEPROM) to determine if the client
> needs A or B.

In the origional code, did Base read the EEPROM and decide what to do?
If not, what class did?