in reply to Re: Feedback on Class::Container
in thread Feedback on Class::Container

educated_foo wrote:
From reading the "Scenario" section of the pod, this sounds like "factory methods."

Yes, it can definitely be used that way, but it can do more too. It supports simple "has-a" relationships, "factory" relationships, and "uses" relationships.

Also, you're talking about "parent" or "child" - it seems like you're thinking of @ISA inheritance, but Class::Container is focused primarily on containment relationships.

Assuming you really did mean containment relationships, if I used a bottom-up approach like the one you're suggesting, I'd have to manage lots of bottom-level objects instead of just one top-level object. That seems very inconvenient. It is supported by Class::Container if you want to do that, though - you can affect a contained object "wheel" (of class "Wheel") when creating the "car" (of class "Car") by any of these three approaches:

-Ken