Class::Base does the minimal amount of work needed to implement hash-based objects with a separation of creation (new) and initialization (init) -- see Conway "Object Oriented Perl", 1st ed., Chapter 6, p. 174. Class::Base objects also have a simple mechanism for logging debug messages (the debug method and the debugging setter to turn it on and off). For my applications, I also appreciated what it does not do: there is no "AUTOLOAD" facility to automatically generate accessors -- since I have my own ideas on accessor naming conventions (I don't like the "get_*" prefix: I do"set_foo"/"foo", rather than "set_foo"/"get_foo"), I wanted to write my own AUTOLOAD. Most of it's competitors get too fancy: Class::Base just does the few things I need, and lets me do what I want.
One quesiton though: what's the purpose of the (oddly named) "_ID" field inside the object? Isn't its value always the same as ref($obj)?
1 out of 1 found this review helpful. Was this review helpful to you? Yes No
I use this module all the time for quick object creation. It's very easy to use just the minimal amount to get a hash-based object, but the code also allows you to do some fancier stuff, too. Rock on, Andy!
Was this review helpful to you? Yes No
1 hidden unhelpful review