|Welcome to the Monastery|
Class::Multimethods namespace collusionby bakunin (Scribe)
|on Feb 16, 2004 at 16:45 UTC||Need Help??|
bakunin has asked for the
wisdom of the Perl Monks concerning the following question:
Yesterday, I decided to use Class::Multimethods to overload my class methods which have endlessly changing argument lists.
As usual, I got my hands dirty right away without carefully reading the excellent tutorial. A surprise, with full of spite, was awaiting:
When I read the tutorial, this line caught my eye:
"...all multimethod variants share a common namespace that is independent of their individual package namespaces."
Meaning, do not use different class constructors with the same name!!
Well, I came up with the following, but again as usual I want to ask the other monks before putting it into the assembly line:
Here are my questions: Am I missing something in Multimethods?
If not, is my method useful? Any side effects that you might think of, esp. with inheritance? How would you solve this?