Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
Welcome to the Monastery
 
PerlMonks  

Re: Encapsulation through stringification - a variation on flyweight objects

by Abigail-II (Bishop)
on Apr 01, 2003 at 22:27 UTC ( #247371=note: print w/ replies, xml ) Need Help??


in reply to Encapsulation through stringification - a variation on flyweight objects

That's what I am already doing with Inside-Out objects.

There are some problems though. First, you have a memory leak. If an object goes out of scope, you aren't cleaning up the attributes. To do so, write a DESTROY function (just like with Inside-Out objects). Second, you'll get a problem if you want to overload stringification.

Abigail


Comment on Re: Encapsulation through stringification - a variation on flyweight objects
Re: Re: Encapsulation through stringification - a variation on flyweight objects
by robartes (Priest) on Apr 01, 2003 at 22:37 UTC
    I thought it would be a bit too much to have been the first to think of this <g>. I had super searched but not on 'Inside-Out objects'.

    I know about the memory leak, I have not included a DESTROY method as this was just an example (the same reason I have not included any accessors, or attribute validation). It's still a valid point though.

    Stringification overload is indeed problematic. One hole poked ;).

    Thx for the comment.

    CU
    Robartes-

      BTW, you can overload stringification /or/ numification just fine, but not both.


      Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://247371]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-04-20 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls