The reason WHY OO sucks

Wiger Ulf <>
Sun Jun 15 12:50:10 CEST 2003


On June 15 2003, "Dr.Dr.Ruediger M.Flaig" wrote:

>In OO, it is often pretty difficult to decide where to attach a
>method which is not tied to an object by logical necessity;
>and when there is a pyramid of objects always appearing 
>together, shall we attach a method to the higher components 
>(wool = shepherd.shear( shepherd.sheep[ n ] )) or to the lower 
>ones (wool = shepherd.sheep[ n ].shear(), or rather 
>wool = shepherd.sheep[ n ].get_shorn())? Does the shaving 
>method logically belong to the sheep  (get_shorn) or to the 
>shepherd (shear)?

This is indeed one of the bigger problems I've seen in large OO
projects: where design rules have not been sufficiently detailed,
different teams tend to implement methods at different levels 
in the class hierarchy, and it eventually becomes very difficult to
reuse code or adapt to new features.

/Uffe



More information about the erlang-questions mailing list