Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Re^6: Flyweights - different meaning in perl?

by demerphq (Chancellor)
on Dec 16, 2002 at 19:59 UTC ( #220319=note: print w/replies, xml ) Need Help??

in reply to Re^6: Flyweights - different meaning in perl?
in thread Yet Another Perl Object Model (Inside Out Objects)

Ok. First off in general I agree with most of what your saying. But I think that you have slightly missed my point.

I think the crux of the matter is highlighted in these two sentences

    Note we are not removing any duplicate state. We are moving state from the object to that objects class.

    The motivation for doing it is data-hiding, not reducing duplicate state.

The point I was trying to make was with the flyweight pattern as described by TheDamian we can do both of these things. The overall design facilitates it much more than most other OO perl models i've seen.

(I think you do have to read that "allows" as meaning that objects are reused - otherwise it's just a null statement)

This one of the few points where I do disagree with you. I think the allows is crucial. Sharing objects in perl in the way that they mean here is not particularly convenient. However sharing attribute data is. And as I think the core objective is to reduce overhead by sharing data, the particular mechanism by which this is effected is not particularly relevent. And the flyweight pattern allows this to be done in an easier way than most other object models.

Lets put it this way, if you or I sat down to implement a flyweight object system, or a shared attribute system, we would end up with an implementation that is basically the same as TheDamians.

Here we talk about sharing objects with the same state. The motivation is to reduce the overhead in having a multitude of objects.

No. The motivation is to reduce overhead by not duplicating data. Sharing objects is just an means to an end.

I agree however that this debate has degenerated ;-) into quibbles. However for me (and I think you too) its been a fun and educational trip.

--- demerphq
my friends call me, usually because I'm late....

  • Comment on Re: Re^6: Flyweights - different meaning in perl?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://220319]
[Lady_Aleena]: I was thinking about moving WorldBuilding to Random, since it is all randomness in that group anyway, but Random::World is the same length as WorldBuilding. I wouldn't be doing myself any favors.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2017-05-25 03:54 GMT
Find Nodes?
    Voting Booth?