nysus has asked for the wisdom of the Perl Monks concerning the following question:
I've begun writing a class of modules for myself to facilitate the gathering of events in my community. I'm using the Moose extension to help me write OO code.
So far, I have an EventRepository class that in ~/perl-lib/EventRepository.pm file on my computer. I now wish to create a subclass of EventRepository that will be called something like EventRepository::SubClass.
I'm unsure where to put the code for SubClass.pm, however. Do I just drop it into ~/perl-lib/ alongside of the EventRepository.pm file. But I see other families of classes nesting their directories inside of one another to mimic the class hierarchy but I'm not sure how to make that work. Do I create an EventRepository folder and put EventRepository.pm inside of that folder along with a SubClass subfolder and drop SubClass.pm into that subfolder?
Any guidance on best practices would be appreciated. Thanks.
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to structure files and subdirectories for related classes and subclasses?
by choroba (Cardinal) on Apr 03, 2016 at 17:02 UTC | |
by nysus (Parson) on Apr 03, 2016 at 17:16 UTC |