in reply to Re: Doubt about fly-weight objects.
in thread Doubt about fly-weight objects.
It seems to me that the basic aspect on which most references that were given to me concentrate is that of caching, which supports the actual "light" nature of these objects, as of the name attribution.
However it doesn't seem to me that the typical example one sees about them is really any lighter than "standard" objects. Granted, I see how one could make them so, but that's a different story. Perhaps flyweight objects are really flyweight in other OO {models,languages}.
Note: With the above I mean that the typical perl example of a constructor is:
or (to speak about Inside-Out):sub new { my $class = shift; my $id = bless [] => $class; $data{$id} = { foo => undef, bar => undef }; # ... $id; }
Sometimes one sees \(my $bogus) instead of [], but basically in these typical constructors a unique id is associated to each object, different for all of them.sub new { my $class = shift; my $id = bless [] => $class; $foo{$id} = undef; $bar{$id} = undef; # ... $id; }
Now one -well, I for one- wonders how an ordering could be find (maybe automatically or semiautomatically) in a document that is inherently hypertextual as to make it into a sequential thing...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Doubt about fly-weight objects.
by dragonchild (Archbishop) on May 17, 2005 at 13:37 UTC | |
by blazar (Canon) on May 17, 2005 at 14:33 UTC |