in reply to Question to OO Masters (about Style)

IMO, I think keeping the same name for that function in the different namespaces is not only reasonable, it's preferred. The same 'check' is being done on all 3 object types, so there's no reason to pretend they are different. And from the standpoint of the Dictionary and higher grouping functions, your OOP should be hiding the recursive nature of that function call to the end developer. Typically in other OOP languages, when classes have a similar behaving non-inherited method, the designers typically have the method name the same as to avoid extra terminology in the API.

Now, however, I would try to make sure that the variable you use are more descriptive than just $d or $e, if this code will be seen by others, unless no abiguity can be inferred. This way, it's understood that you're doing a consistancy check on a dictionary object or a entry object, as opposed to figuring out what each is.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important

  • Comment on Re: Question to OO Masters (about Style)

Replies are listed 'Best First'.
Re: Re: Question to OO Masters (about Style)
by PetaMem (Priest) on Nov 05, 2001 at 00:51 UTC
    Hello,

    Thanks for all your responses. To clarify things a bit: I of course use more verbose variable names than $d or $e. (not to speak of $a and $b :-))

    My worries were not so much about the readability for an "end developer" as was stated here, but about the readability of the code by myself. As this is a long term project, I WILL have to dig through the code perhaps in 2 years. And now we all know, that perl has a little bit the reputation, that one cannot read his own code after a while.

    Entry is not derived from Dictionary (or vice versa), they are completedly separated classes, DIctionary is just some kind of container for (many) Entries.

    Yes, this is real-world scenario, no academic talk. 11 Languages (dictionaries) take 800MB of RAM. Long live Perls Memory Management. :-))

    And this beast knows already the difference between a Monkey and a Car.

    Bye
    Richard