Re: Abstract Method w/o Factory
From: Daniel T. (postmaster_at_earthlink.net)
Date: 10/19/03
- Next message: Topmind: "Re: Naive, possibly silly question"
- Previous message: Daniel T.: "Re: Question about removing duplication: inheritance vs static methods"
- In reply to: Benjamin M. Stocks: "Re: Abstract Method w/o Factory"
- Next in thread: Uncle Bob (Robert C. Martin): "Re: Abstract Method w/o Factory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
- Next message: Topmind: "Re: Naive, possibly silly question"
- Previous message: Daniel T.: "Re: Question about removing duplication: inheritance vs static methods"
- In reply to: Benjamin M. Stocks: "Re: Abstract Method w/o Factory"
- Next in thread: Uncle Bob (Robert C. Martin): "Re: Abstract Method w/o Factory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]