I'm starting to confuse myself again now.
Yes, you are.
I've got it into my head that I'm going to have an instance of Trainset as a holder to contain track, signals etc, so I'll do something line:
my $tset=Trainset->new; $tset->add_track('TCB',['TCB1','TCB2']);
Everything you've said to here is correct.
The problem here is that I'm using a Trainset object to call a method of
Trainset::Track.
If that's what you are doing, yes that is the design flaw. Now I understand why you were using "base" in the earlier example. That's bad and you don't want to go that way.
Trainset isn't a child object of all your other objects, it's a master object that provides an interface for using all those other objects. Trainset needs and add_track() method which calls Trainset::Track's constructor, does any other needed initialization (linking for example), and stores the references in some Trainset instance variable for future reference.
Did that make any sense?
This is probably why you have also been so insistent about keeping the $owner objects everywhere. You get all this fixed up and you may not even need them at all, which is what I've always suspected would be the case.
James
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
