bloated base class?
centigrade0_at_gmail.com
Date: 12/09/04
- Next message: EventHelix.com: "Re: bloated base class?"
- Previous message: Robert C. Martin: "Re: Transfering data between objects"
- Next in thread: EventHelix.com: "Re: bloated base class?"
- Reply: EventHelix.com: "Re: bloated base class?"
- Reply: H. S. Lahman: "Re: bloated base class?"
- Reply: kevin cline: "Re: bloated base class?"
- Reply: Doc O'Leary: "Re: bloated base class?"
- Reply: vladimir_levin_at_yahoo.ca: "Re: bloated base class?"
- Reply: Daniel T.: "Re: bloated base class?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 8 Dec 2004 18:23:54 -0800
Hello,
In a data processing application, that can be very roughly described as
[input]->[processing]->[output], there is a single input class, let's
call it class Input. Now the app needs to be extended to process a
different kind of input. I'd like to make use of as much of the
existing code as possible. A basic refactoring comes to mind:
class AbstractInput;
class OldInput : public AbstractInput;
class NewInput : public AbstractInput;
The problem is that OldInput and NewInput encapsulate different data.
So most of the get/set methods in OldInput don't belong in NewInput,
and vice versa. The users of these classes need the old or new
interface depending on what kind of data they work with. One option is
to bloat the interface of AbstractInput, adding there the methods from
both OldInput and NewInput... this would enable polymorphism, but it
just doesn't feel right. Anyone can suggest a nicer way to tackle this?
Thanks.
- Next message: EventHelix.com: "Re: bloated base class?"
- Previous message: Robert C. Martin: "Re: Transfering data between objects"
- Next in thread: EventHelix.com: "Re: bloated base class?"
- Reply: EventHelix.com: "Re: bloated base class?"
- Reply: H. S. Lahman: "Re: bloated base class?"
- Reply: kevin cline: "Re: bloated base class?"
- Reply: Doc O'Leary: "Re: bloated base class?"
- Reply: vladimir_levin_at_yahoo.ca: "Re: bloated base class?"
- Reply: Daniel T.: "Re: bloated base class?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|