in reply to Re: OO automatic accessor generation
in thread OO automatic accessor generation
You're right, after actually getting around to testing it with multiple instances, perl started to complain about sub redefinitions, so the constructor is not the best place to do this :)
I've now made a base class by shamelessly copying your code :P and made a Datatable class that inherits the base class and adds SQLquery-generating subs.
Unfortunately, it seems I will need to try both methods of OO-programming...the manual method to further my understanding of things, and using Moose to leave maintainable code for my colleagues :)
Also, right now the automatically generated accessors don't check anything about the data they are given. This is not how it is supposed to end up (at which point I will probably have to take them out of the autogenerated batch or try something like reassigning a new sub whenever the need arises) but just to get started.
|
|---|