http://www.perlmonks.org?node_id=11122962


in reply to Re^2: Module design for loadable external modules containing data
in thread Module design for loadable external modules containing data

This is just my two cents and very opinionated but ...

One solution I have is to abstract as much as possible the lesson content and provide an higher level language to define a lesson, probably YAML will be enough. I dont like very much this solution because it will force the author to write YAML instead of perl code.

You're just getting started here. You can't even just tell them to write YAML because you're really creating a Domain Specific Language. It still won't be all of YAML, it will be a specific subset with expressions that mean something to Perl::Teacher but not YAML. (etc etc, I'm not trying to prove the point, just hoping you can see it)

The other point I'd like to raise is that, despite OOP, in practice, we (programmers) almost always segregate data and code. IMHO, Perl::Teacher should take a cue from things like Text::CSV and XML::LibXML and process data rather than contain it. The code can live on CPAN and the data on github or whatever and just get pulled via https or whatever.

I hope my post isn't discouraging. I think it's great that you're experimenting with an interesting blend of semantics and code.

  • Comment on Re^3: Module design for loadable external modules containing data