Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-11-28 19:51 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (744 votes), past polls