On Wed, Jan 27, 2010 at 12:22 PM, Lyle <[email protected]> wrote: > Hi All, > I have a main object that I don't want to just keep exporting new > methods to. So instead I'm exporting new objects. The way I'm doing it > is like so (cut down):- > > package ExtObj; > ... > package Plugme::guts; > ... > This gives me $OrigObj->ExtObj->new_methods; >
Confused. Does Plugme::guts inherit from ExtObj ? If so then it looks like, given you'll only ever have one $extobj, things will only work if Plugme::guts is the only class to inherit from ExtObj. Which would be weird. What's the problem you're trying to solve? "Extending an object with an object" sounds like aggregation, or perhaps delegation. Aggregation would just involve object A holding a reference to object B and implementing some of its own methods by calling methods of object B; delegation would involve object A holding a reference to object B and passing some method calls direct to object B. The latter could be done with an AUTOLOAD fairly sensibly. Need more clues! Alex _______________________________________________ BristolBathPM mailing list [email protected] http://mailman.bristolbath.org/mailman/listinfo/bristolbathpm
