Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.programming
Object oriented array inheritance
Victor Porton
12/3/2015 5:25:00 PM
My classes are associated with a (constant) array (specifying how fields of
the data should be validated before storing to a database).
I need to make inheritance of arrays, that is in derived class adding some
new elements to the array from the parent class.
In Perl syntax, it is possible to describe it in the following ways:
sub fieldValidators {
my ($self) = @_;
return (
$self->SUPER::fieldValidators(),
[ ... ],
[ ... ],
...
);
}
or:
sub init {
my ($self) = @_;
$self->SUPER::init();
$self->addFieldValidator(...);
$self->addFieldValidator(...);
...
}
Which of the two ways (using the array returning method fieldValidators() or
constructor init()) is the best? Any other variants?
--
Victor Porton -
http://porton...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Object oriented array inheritance
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password