I've got one large object. I have dozens of other, smaller objects. Within each of these smaller objects, I'd like to store the one large object in an attribute so the smaller objects can refer to it easily. Is there an advantage to storing the large object as a reference to the large object instead of the object itself?
I think it won't make a difference because the large object is itself essentially a reference to the data. But I just want to make sure. Or maybe there is some other reason I should store a reference to the larger object that I'm not thinking of? Thanks.
Follow up question: I'm using Moose. Should I consider breaking out the MooseX::ClassAttribute module to store the large object? How, exactly, is using a class object any different than storing the large object in all the objects? Does it buy me anything?
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
In reply to Is there an advantage to storing references to objects in an attribute instead of the object itself? by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |