From: Vsevolod (S. I. <si...@cs...> - 2003-12-22 19:51:52
|
Chris, > Coincidentally, I made a change in 0.80 that allows you to do: > > SPOPS class: SPOPS_Books > Your class: MyBooks isa SPOPS_Books > SPOPS class: SPOPS_Publisher > Your class: MyPublisher isa SPOPS_Publisher Thanks! This almost works out for me. But here is the problem: my classes have a superclass. Let's call it MyObject. So I inherit MyBooks from SPOPS_Books and MyObject. I have to double-dispatch the new() method, but I can live with it. However, I use strict field checking and field autodiscovery. When I begin to store attributes in MyObject via the regular Perl getter/setter methods which use $self as a hashref, I start to get SPOPS errors about accessing fields that are not present. Obviously, I can turn strict fields off, but I'd like to retain that. The alternative is to somehow keep autodiscovery, but add in the config hash of SPOPS_Books additional fields which correspond to "instance variables" of MyObject. I am not sure how to do it, but even if I could, it's messy because I'll have to repeat it in every SPOPS_* class. This can be made a little less messy if I do not inherit from MyObject, but store a reference to it, but this one reference still has to be mentioned in SPOPS config. Simon -- Simon (Vsevolod ILyushchenko) si...@cs... http://www.simonf.com America's business leaders simply don't want to think about complex technology issues - they want to think about golf. Microsoft promises them that. Andrew Grygus, www.aaxnet.com |