I think overriding the methods of the existing class is poor choice. The
only reason that I would suggest this is if there was some drastic
performance issue when moving the functionality outside of the class, but I
don't see that happening. It is better program design to leave the original
class alone. It makes your code more readable, reusable and maintainable. It
also allows your class to be more reusable for other projects and other
people.

I suggest a book reading...

"Design Patterns
 Elements of Reusable Object-Oriented Software" by Erich Gamma, Richard
Helm, Ralph Johnson and John Vlissides.

It's a deep reading, but it's a good one.

HTH,

Zac





-----Original Message-----
From: Florian Weber [mailto:csshsh / structbench.com]
Sent: Wednesday, June 16, 2004 4:42 PM
To: ruby-talk ML
Subject: Re: how to design plugin functionality


im really sorry. i think it was really misleading to give such a
concret example. basically the example i gave is purely fictional.

basically i was more wondering if overwriting methods (methods of
the same class, not methods of a superclass) is a recommended
good practice for functionality which can be plugged in or
if such things should be done in a traditional way, where a object
is 'plugged' in between, which decides if the additional functionality
should be executed or not.

sorry for the misunderstanding =)

ciao!
florian



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.705 / Virus Database: 461 - Release Date: 6/12/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.705 / Virus Database: 461 - Release Date: 6/12/2004