Re: Booch's book feels too philosophical rather than practical?
- From: "topmind" <topmind@xxxxxxxxxxxxxxxx>
- Date: 25 Jan 2007 21:24:01 -0800
On Jan 23, 5:30 pm, "Daniel T." <danie...@xxxxxxxxxxxxx> wrote:
"topmind" <topm...@xxxxxxxxxxxxxxxx> wrote:
"Daniel T." <danie...@xxxxxxxxxxxxx> wrote:
"topmind" <topm...@xxxxxxxxxxxxxxxx> wrote:
But you forgot to mention another change pattern: loss of mutual
exclusiveness. If 2+ options change to no longer be mutually exclusive,
then procedural fairs better. It is a smaller change: just change the
CASE to IF statements. With polymorphism you have to move code to
different named modules, and I give that a much higher change cost
score.
An example please.
http://www.geocities.com/tablizer/bank.htm#fee
Remember what I said:
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.
You are correct. But that was not what was being investigated and
compared.
In your example, *every* case statement that made a decision based on
account type would have to change into the "if" version.
That is why one should avoid conditionals based on noun taxonomies.
That example was not illustrating how to design apps, but the affects
of M.E. loss. (I already agreed that I may need to clarify that so that
one does not confuse the two examples.)
Also, every
time a new account type was added (a far more likely scenario than
changing the way current accounts work,) every case statement would have
to change.
Agreed, but irrelavent to what is being discussed. (And, consider
adding a new operation to each "sub-type".)
How many case statements are in this code? From the chart, it
looks like there would be 10 of them. That's a lot of duplication in my
book.
I don't have no fricken 10 case statements. What the fudge are you
talking about?
-T-
.
- References:
- Booch's book feels too philosophical rather than practical?
- From: arnuld
- Re: Booch's book feels too philosophical rather than practical?
- From: Daniel T.
- Re: Booch's book feels too philosophical rather than practical?
- From: topmind
- Re: Booch's book feels too philosophical rather than practical?
- From: Robert Martin
- Re: Booch's book feels too philosophical rather than practical?
- From: topmind
- Re: Booch's book feels too philosophical rather than practical?
- From: Daniel T.
- Re: Booch's book feels too philosophical rather than practical?
- From: topmind
- Re: Booch's book feels too philosophical rather than practical?
- From: Daniel T.
- Booch's book feels too philosophical rather than practical?
- Prev by Date: Re: Booch's book feels too philosophical rather than practical?
- Next by Date: Re: Biz Tree Challenge
- 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):
Relevant Pages
|