Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Module design for loadable external modules containing data

by Fletch (Bishop)
on Oct 14, 2020 at 16:53 UTC ( [id://11122835]=note: print w/replies, xml ) Need Help??


in reply to Module design for loadable external modules containing data

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.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122835]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2024-04-23 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found