Phrasebooks

barbie on 2004-02-11T09:51:34

In December, Spoon passed some code my way in relation to the reworking of Class::Phrasebook that I wanted to do. Rani was rather reluctant to change the current setup, so I thought it best to code an alternative version, so that he could see what I was getting at. Spoon's code went a lot further than I had thought at the time and includes a very nice factory function for all the Loader modules. He's also implemented the proper class idea that I was trying to get at, but couldn't quite figure how to do. It is a very good example of OO programming and has taught me a few things about Class::MethodMaker, which I shall hopefully use more of in the future.

Spoons original distribution came bundled with a YAML implementation, which I'm currently extracting into a separate distribution. I figured that the default loader should simply be a plain text file with no frills. After that YAML, Ini, XML (as per Class::Phrasebook) and DBI loaders can be installed as plugins as and when required. After creating working loaders, I then need to look at adding the debugging features, again as per Class::Phrasebook. I suspect this will probably not reach CPAN, at least not as Class::Phrasebook, but it will be available online should anyone be interested.