Given that a dear friend of mine is suffering from a personal tragedy which has impacted me quite heavily, I've not been terribly responsive to email lately. If I've ignored you, please don't take it personally.
To distract myself, I've been updating Class::BuildMethods to handle class data. I really didn't want to extend this module, but class data is too important to ignore. If I get more tuits, I'll also make it serializable via Storable, but with the caveat that if there's any state data stored outside of the interface, it won't be able to handle it.
The serialization issue annoys me a bit because I keep getting criticisms that this module doesn't allow one to easily serialize data, but since it was designed to add state data to existing classes regardless of implementation, I didn't think it was important since I could not guarantee that one could serialize all data. However, if all data is set via this module, then the serialization is appropriate.
If I get even more tuits, I'll build a threaded Perl and see if I can make it thread safe. However, I have a friend from the US visiting next week and we're off to Dublin, so no guarantees.
I've also discovered that I rarely use its validation capabilities. Instead, I tend to do this:
package Customer; use Class::BuildMethods qw/_age/; sub new { bless $any_reference_you_want, shift } sub age { my $self = shift; return $self->_age unless @_; my $age = shift; die "Too young" if $age < 21; $self->_age($age); }
In the above example, I really should use the validation callback because I'm needlessly duplicating code. But if things are really complicated, I can use this technique of wrapping private methods in a public method to give myself fine-grained control.