in reply to OO Data Structures ?
What it sounds like is that when you instantiate an object, you pre-populate it with a bunch of data, possibly use data the user gives you, then returns the object.
What about doing something like:
If you do it right, this will allow for both attribute and value inheritance.sub new { my $class = shift; my %attributes = @_; $class = ref($class) || $class; # Cargo-cult! my $self = $class::SUPER->new(@_); # Finish up here. return $self; }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|