More good points! Peeling away the layers of the onion has certainly been nice 
though and definitely in the spirit of learning which I was writing this code 
to begin with. Thanks Bill.
I approached this purely from an OO design perspective without regard to the 
language much less the implementation. 
From: [email protected]
Date: Sun, 2 Nov 2014 11:51:47 -0500
Subject: Re: [Boston.pm] object composition (has-a) with built-in OO system
To: [email protected]
CC: [email protected]


On Sun, Nov 2, 2014 at 11:39 AM, Adam Russell <[email protected]> wrote:
Ah, ok, thanks for spelling that out!In my code I used a scalar reference so I 
seem to have stumbled onto that without really appreciating it.
​In strongly typed OO, particularly where the only automatic GC is stack-based, 
embedded ​has-a is essential for any semblance of sanity.  It's pretty rare 
that we need embedded has-a in Perl; for instance, large complex 
data-structures with memory efficiency  issues under standard GC.  (Those are 
cases where you may want to manage a private homogenous heap to avoid 
fragmentation.)  
This falls under the second rule of optimization:
Rules of Optimization1. Don't.2. For experts only, don't optimize 
YET.​(meaning, try it straightforwardly first, then MEASURE . Fix the ACTUAL 
bottlenecks not where you expect. then Document it.) ​


-- 
Bill Ricker
[email protected]https://www.linkedin.com/in/n1vux 

                                          

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to