![]() |
|
Do you know where your variables are? | |
PerlMonks |
Moose design questionby elTriberium (Friar) |
on May 19, 2011 at 18:51 UTC ( #905775=perlquestion: print w/replies, xml ) | Need Help?? |
elTriberium has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I have a question about designing Moose classes: I have a module A which has multiple features B, C, D, because multiple people will work on these and it would be nice to have this logical separation of the different features. The features B, C, D need to have access to A themselves (they run something on A). I want to put A, B, C, D, ... into different files. The user should only have to instantiate A and then use the other classes through it, such as:
A simple way to make this work would be:
But this solution doesn't seem to be very 'clean' apart from that it does what it should. It's not making use of any OO concepts, it's just hardcoding the different classes together. I'm not very familiar with Moose Roles, could I use those to achieve the desired behavior?
Back to
Seekers of Perl Wisdom
|
|