Re: Booch's book feels too philosophical rather than practical?
- From: "topmind" <topmind@xxxxxxxxxxxxxxxx>
- Date: 23 Jan 2007 13:02:42 -0800
Robert Martin wrote:
On 2007-01-21 21:59:31 -0600, "topmind" <topmind@xxxxxxxxxxxxxxxx> said:
Using the overused "shape" examples, you have two "lists": lists of
shapes and lists of operations on those shapes. If you factor out the
duplication of one list you introduce duplication of another. OO'ers
don't bother to count the repeated method list as "duplication" because
they are brainwashed to ignore such duplication.
There are indeed two lists. OO does not deny this, it takes advantage of it.
Procedural programming allows you to add new functions without changing
the existing data structures. OO allows you to add new data structures
without changing the existing functions. You need both capabilities.
You mean adding functions and "subtypes" without changing existing
code? There are table-driven ways to do such and even file-driven ways.
It is just meta-tizing functions and structures. I don't find a
practical need for such very often in biz apps, though.
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.
--
Robert C. Martin (Uncle Bob) | email: unclebob@xxxxxxxxxxxxxxxx
-T-
.
- Follow-Ups:
- Re: Booch's book feels too philosophical rather than practical?
- From: Robert Martin
- Re: Booch's book feels too philosophical rather than practical?
- From: Daniel T.
- Re: Booch's book feels too philosophical rather than practical?
- 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
- 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: 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):
Relevant Pages
|