Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Class::Flyweight - implement the flyweight pattern in OO perl

by Anonymous Monk
on Jul 09, 2001 at 22:58 UTC ( #95104=note: print w/ replies, xml ) Need Help??


in reply to Class::Flyweight - implement the flyweight pattern in OO perl

I don't see very much Flyweight going on here. You may want to call your package Class::Privacy. Explanation: You store a scalar per instance, provided the instance stores a scalar too. No space saved. The Idea of Flyweight is: Many instances store common values (mostly arrays and hashes (or records in other languages)),that are related, as one constant value represented as a pointer (or ref) thereby saving memory, provided they don't modify the pointed to value. Modifyability is achieved by not only storing the pointer but overriding values in the instance too in the hope that many values are common and only a few must be overridden. An instance can modify its value by changing the pointer (and possibly choosing appropriate overrides) too. NOTE: The pointer is not the constant, it's the pointed to value that's constant.


Comment on Re: Class::Flyweight - implement the flyweight pattern in OO perl

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2014-09-23 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls