in reply to Cross-Package/Object Communication
I'd suggest you go back to role-playing the real task, and seeing who needs to talk to what. In general, a "manager object" is a very bad idea, especially when it turns out to be a singleton. You've just thrown away most of the advantages of OO when you get to that point.
For example, the LWP::UserAgent class might at first glance appear to be a "manager object", but it's really an object that maps to a particular browser, which is a real thing. And just as you can have multiple browsers, on your desktop, you can have multiple instances of LWP::UserAgent in your program.
So, rethink your problem from the perspective of actors, not data, and your need for a "Primary object" will probably go away or take on an obvious new role. Such is the OO way.
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Cross-Package/Object Communication
by billyak (Friar) on Aug 21, 2002 at 16:15 UTC | |
|
Re: •Re: Cross-Package/Object Communication
by IOrdy (Friar) on Aug 21, 2002 at 16:28 UTC |