different versions of objects
[prev]
[thread]
[next]
[Date index for 2005/04/06]
Slightly odd question this ...
I have various objects and all these objects have versions. What I want
to be able to do is
$package = Package->new($name); # latest version
$package = Package->new($name, $version); # gets $version
$package->version(); # returns $version
$package->version($new_version); # changes to $new_version
I suspect what the best thing to do is make Package have an id and a
name and has_many Package::Version. Package.pm will then have an
AUTOLOAD which forwards any method calls not covered in Package.pm
(name, version) to $self->{_current_version}->$method or something
similar.
Does that sound sane?
Simon
--
all content and no style
|
different versions of objects
Simon Wistow 16:31 on 06 Apr 2005
|