Syntactic Confectionery Delight | |
PerlMonks |
Re: Module design for loadable external modules containing databy Fletch (Bishop) |
on Oct 14, 2020 at 16:53 UTC ( [id://11122835]=note: print w/replies, xml ) | Need Help?? |
Completely off the cuff and haven't thought too deeply about it but: This (at initial blush) sounds like you want to define a role (maybe Perl::Teacher::Roles::CourseProvider) which enumerates what things you expect a "course" to be able to do (e.g. maybe course_abstract gives the overview what it's about; list_topics returns a list of topics covered in the course; topic_abstract( NAME_OR_NUMBER ) takes a name or index (in the list returned by the prior) and returns the details on that topic; ETC). The individual course modules would then implement those methods. If you do it right you probably could even then get a base parent class which would read YAML/JSON from the DATA section and concrete modules would inherit from that. </handwaving>
The cake is a lie.
In Section
Seekers of Perl Wisdom
|
|