Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Overriding Methods at Runtime (or maybe not?...or other alternatives?)

Expand Messages
  • merlyn@stonehenge.com
    ... SiehMonster With that said, I would like to override the calculate() SiehMonster method of these classes at construction time based on SiehMonster
    Message 1 of 2 , Dec 4, 2003
    • 0 Attachment
      >>>>> "SiehMonster" == SiehMonster <siehmonster@...> writes:

      SiehMonster> With that said, I would like to override the calculate()
      SiehMonster> method of these classes at construction time based on
      SiehMonster> checking the config file as to if this class has
      SiehMonster> pre-calculated values in the database. Furthermore, I
      SiehMonster> have a FetchDB class which fetches the pre-calculated
      SiehMonster> values from the database. FetchDB and parent class A I
      SiehMonster> can modify to my hearts desire. I would like FetchDB
      SiehMonster> calculate() methods to override the "a through z" class
      SiehMonster> calculate() methods. Is there a way to do this? Or, is
      SiehMonster> this wishful thinking?

      So, don't make it a class A. make it a class MyA that @ISA A, but
      has your cached-accessing ->calculate().

      If you want to keep it light, use Class::Prototype or
      Class::Classless, and you can create lightweight "classes" that have
      the right inheritance and overriding.

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.