Re: Booch's book feels too philosophical rather than practical?
- From: "Daniel T." <daniel_t@xxxxxxxxxxxxx>
- Date: Mon, 22 Jan 2007 11:49:19 GMT
"topmind" <topmind@xxxxxxxxxxxxxxxx> wrote:
Daniel T. wrote:
"arnuld" <arnuld3@xxxxxxxxx> wrote:
When you see two switch statements that both switch off of the same
variable, or two if statements that both check the same condition, just
knock yourself on the head for not catching it beforehand and create
polymorphic classes to remove the duplicated decision code.
Case/Switch bashing again, eh? [cue good/bad/ugly theme music]
The case (pun) is not so clear cut. Turning conditions into
polymorphism forces one to hard-wire an assumption of mutual exclusion
into the design. If later those options turn out not to be
mutually-exclusive, the case or IF statements are far easier to change
If you have multiple case/switch statements all switching off of the
same variable and "those options" change in any way, you have to change
every case/switch statement. If you only have one case/switch
statement, then you only have one place that needs to change.
.
- Follow-Ups:
- References:
- Prev by Date: Re: Simples Rules make creating Big Balls of Mud impossible.
- Next by Date: Re: Booch's book feels too philosophical rather than practical?
- Previous by thread: Re: Booch's book feels too philosophical rather than practical?
- Next by thread: Re: Booch's book feels too philosophical rather than practical?
- Index(es):