|Pathologically Eclectic Rubbish Lister|
Re^2: [Moose] Critique request on my Moose design (anti?)patternby three18ti (Scribe)
|on Feb 01, 2014 at 08:27 UTC||Need Help??|
Hey thanks for the reply.
For instance, if I'm building a Car object, I'll probably want to declare an "Engine" object and then handle the delegation of that objects methods in the Car object.
(actually, the equation for rpms doesn't make any sense, but it was just to show that ->get_rpm is different than ->rpm)
In the real world I'm working on a library to manage VMs and I've created several objects to represent things like the Hypervisor Cluster and the VM (which represents all the attributes for the vm, the actual running vm is then represented by a different object which I'm trying to figure out how to handle).
I don't know what the correct term for "Car::Engine" would be in this case which is why I called it a "sub-object" in my previous comment.
I just seem to be using the pattern a lot which results is a lot of duplicate typing (or cut and paste) which got me to thinking maybe there's a better way to go about using objects in my primary (in this case "Car") object.