in reply to Re: Tracing zombie variables.
in thread Tracing zombie variables.

  > In the case I proposed this is not really a factor as the
  > only method calls that I suggest you support is new() and
  > DESTROY() and they only get called once per object and
  > thus the overhead is negligable.

You're indeed right demerphq.
I was blinded by the method explained in Mastering Algorithms with Perl
which has methods for next() and prev().

Thank you for enlightenment.

-- 
Ash/asksh <ask@unixmonks.net>

Replies are listed 'Best First'.
Re: Re: Re: Tracing zombie variables.
by demerphq (Chancellor) on Aug 29, 2002 at 13:23 UTC
    s blinded by the method explained in Mastering Algorithms with Perl which has methods for next() and prev().

    And rightly so. You _should_ supply such methods. If there is any chance that someone outside of your module will need to access these methods/attributes then you should provide a method interface for them to do so.

    However inside of your module, the one that manipulates the actual data structure, you can certainly make the design decision to use the underlying object implementation. After all it is your code and your implementation so the only one that you can burn is yourself.

    For instance I completely bypass the method interface for my node objects in my Treap implementation. However my node is a subclass of a Class::Struct so that anything outside can have something more stable to utilize. (ie no nasty suprises for users that use the method interface).

    Yves / DeMerphq
    ---
    Software Engineering is Programming when you can't. -- E. W. Dijkstra (RIP)