* Christopher Hicks <[EMAIL PROTECTED]> [2005-01-18 20:54]: > Do you have any evidence of this?
Nothing scientific, just observation and gut feeling. One thing I can say for sure though is that I've never seen a case where someone had to be told "that's an IS-A, not a HAS-A", while I've seen plenty of cases like this one where people were told the reverse. > I can guess that this may be the result of bulk of OOP > education emphasizing inheritence so people presume that its > the best way when its merely one choice. I think it's not emphasis; I think the bulk of OOP education doesn't even attempt to discuss these choices in the context of building a system, rather, they just cargo cult examples (Dog ISA Animal or Car ISA Vehicle, anyone?) to explain how OO works on the implementation level and leave its application as an excercise to the reader. There are probably a few good books that do things better than this, but all material I come into contact with as a neophyte looked like this. I think there simply is also a psychological allure to inheritance that makes people want to use it. I know I used to be among them. > but in reviewing other folk's OOP code I would say that a total > lack of design sense or standards is much more rampant than > inheriting where it doesn't make sense. Yes, this is true. Thinking about it it seems to depend on the environment. The problem is more apparent in the Java world. The worst horror stories I heard were told of Smalltalk class hierarchies with code factored into tiny classlets used to inherit wherever possible. I guess the heavier the culture emphasizes OO purity, the bigger this problem becomes. > Since this is a list closely related to CPAN I'm particularly > curious if there are examples where published modules are > breaking this rule. Not that I'm aware of, but of course I haven't looked at all of the bad code on CPAN. Perl code doesn't tend to use elaborate OO design in general though. Rarely are there more than a few classes, much less actual abstract (in intent) base classes. So based on the aforementioned observations I would say it is likely to be less of an issue with Perl. Regards, -- Aristotle "If you can't laugh at yourself, you don't take life seriously enough."
