Re: What databases have taught me

From: Robert Martin <unclebob_at_objectmentor.com>
Date: Tue, 27 Jun 2006 22:39:06 -0700
Message-ID: <2006062722390616807-unclebob_at_objectmentorcom>


On 2006-06-23 01:51:59 -0700, Joerg Simon <j_simon_at_gmx.at> said:

> 
> frebe73_at_gmail.com wrote
>  >
> [snip]

>> I think that the main disadvantage with OO is that it is not
>> multi-dimensional. OO textbooks like to use animals as an example. They
>> like to build a polyphormic hierarchy like this:
>> Fish
>> - Shark
>> - Tunar
>> Bird
>> - Eagle
>> - Condor
>> Mammal
>> - Horse
>> - Dolphin
>> - Bat
>> This is the correct zooligical hierachy. But what if there are features
>> (or behavior) that are common for all animals that can fly or that
>> lives in water? Many business entities like bank accounts and employee
>> types, are almost impossible to classify in hierachies.

It is unfortunately true that there are books that describe OO this way. However, it has been known for quite some time (probably since the beginning of OO) that this was an inappropriate way to look at OO. While classification structures do exist, they aren't typically deep, and they aren't typically common. What's more, they are based on behavior rather than on state.

It is not hiearchy that drives OO, it is dependency management. It is the decoupling of callers from callees through the mechanisms of dynamic polymorhism that is the driving force behind OO design.

-- 
Robert C. Martin (Uncle Bob)  | email: unclebob_at_objectmentor.com
Object Mentor Inc.            | blog:  www.butunclebob.com
The Agile Transition Experts  | web:   www.objectmentor.com
800-338-6716                  |
Received on Wed Jun 28 2006 - 07:39:06 CEST

Original text of this message