Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Proxy Objects

by Matts (Deacon)
on Aug 13, 2002 at 12:19 UTC ( #189752=perlnews: print w/replies, xml ) Need Help??

In case people don't read very regularly, you might be interested in my new article up there about Using Proxy Objects to build Garbage Collected Circular References. The article should be useful for anyone who doesn't know much about how perl manages memory, or has never heard of the Proxy design pattern before.

Since have no forum on thier site, it'd be nice and useful for me to hear some sort of feedback regarding the article, particularly from the readers of perlmonks.


Edited: ~Tue Aug 13 17:39:54 2002 (GMT) by footpad: Moved to Perl News, per Consideration

Replies are listed 'Best First'.
Re: Proxy Objects
by simon.proctor (Vicar) on Aug 13, 2002 at 12:48 UTC
    Speaking personally I rather enjoyed the article. I also thought it was well written (but then most things on are :P ).

    I have been looking at the design patterns with the work I do at work, but I had never considered using the Proxy for this particular purpose so ++ for that :).

    More of the same (or better) says I.
Re: Proxy Objects
by erikharrison (Deacon) on Aug 13, 2002 at 15:02 UTC

    I enjoyed the article and learned a few things. I was already familiar with Perl's GC, and the information there was clear and concise. Your explanation of the proxy design pattern was also nice coverage of the material.

    Two things about the article really stood out. First, covering a very clear example of why you would want to create a circular reference. The standard $a = \$a while correct, doesn't explain the use a circular reference would have, and why to intentionally create one. Well done.

    Second, and also greatly appreciated was the discussion of weaken. That 5.6 had introduced core support for handling circular refs was new to me, and the coverage of the feature there was clear, and a nice surprise. I haven't seen the 5.8.0 docs yet, but this material would all be very useful in perlreftut.


    Light a man a fire, he's warm for a day. Catch a man on fire, and he's warm for the rest of his life. - Terry Pratchet

      The other nice thing about 5.8.0 is that Scalar::Util is included (which for those wondering, is why I didn't use the CPAN WeakRef module), so you don't need to install any extra modules to get weaken().
Re: Proxy Objects
by adrianh (Chancellor) on Aug 13, 2002 at 13:03 UTC

    I liked it. Interesting solution to circular refs. Especially since I was considering a problem with them at the time :-)

Re: Proxy Objects
by TStanley (Canon) on Aug 13, 2002 at 13:53 UTC
    Very interesting article. It gave me a better understanding of how the garbage collector works.

    Never underestimate the power of very stupid people in large groups -- Anonymous

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlnews [id://189752]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2017-09-23 09:40 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (272 votes). Check out past polls.