faceless has asked for the wisdom of the Perl Monks concerning the following question:
andpackage Aa; use Bb; my $object = Bb->new();
Obviously, bad arhitecture, but a lot of other things depend on these, so I wasn't sure how can I solve these things. I know this is not entirely related to Perl, it has more to do with programming theory, but I thought Perl has some specific things regarding this, like how could I use some design pattern, if there is one for these situations. There are some other kinds of cyclical dependencies too, likepackage Bb; use Aa; my $object = Aa->new();
andpackage Aa; use Bb; my $result = Bb::some_function_which_does_not_create_object();
These can be broken sometimes by taking out one modules functionality and putting it into another module (class) and then each of the 2 modules can use this new one, breaking the cycle, but this solution is not working all the times either. Could any one help me towards this? Thanks in advance, faceless.package Bb; use Aa; my $object = Aa::some_function_which_does_not_create_object();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Trying to break cyclical dependencies in Perl modules
by Utilitarian (Vicar) on Sep 07, 2010 at 10:31 UTC | |
|
Re: Trying to break cyclical dependencies in Perl modules
by JavaFan (Canon) on Sep 07, 2010 at 11:25 UTC | |
|
Re: Trying to break cyclical dependencies in Perl modules
by bart (Canon) on Sep 07, 2010 at 18:07 UTC | |
by faceless (Novice) on Sep 16, 2010 at 07:31 UTC | |
|
Re: Trying to break cyclical dependencies in Perl modules
by tospo (Hermit) on Sep 07, 2010 at 13:13 UTC | |
|
Re: Trying to break cyclical dependencies in Perl modules
by ikegami (Patriarch) on Sep 07, 2010 at 15:53 UTC |