Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Re: OO-style modifiers for 'sub' ?

by l2kashe (Deacon)
on Jan 27, 2003 at 06:32 UTC ( #230141=note: print w/replies, xml ) Need Help??

in reply to Re: OO-style modifiers for 'sub' ?
in thread OO-style modifiers for 'sub' ?

I was thinking something along these lines while in the shower. (Best place to code) :P..

Anywho... Thinking about the problem space, and what is needed, it just felt wholly unPerish to write the same or very similar code time and again.

My actual thought was implementing a group of methods, possibly a seperate Class, which did validation. Then providing it a list of method names which needed to be within the inheritance tree. Something along the lines of maybe
use Validate; ($ok, $err) = $obj->validate( isa => [this, that, theother], can_do => [meth1, meth2, meth3], ); croak $err if (!$ok);
If they existed, then who cares who's calling. Then I thought "What if they override a prerequisite method within their own space"?.. Well if they do, then A) They know what they are doing, hence can use our code or B) They have no clue what they are doing, can't quite figure something out, or are trying to shutgun something together and deserve what ever quirks pop up.

So I haven't really added anything to this thread, so I'm sorry. But I like the post Im replying to and its simplicity, and just wanted to pipe up that its how I was thinking of doing it as well, so an additional ++ to you cause I only have 1 vote for ya.

/* And the Creator, against his better judgement, wrote man.c */

Replies are listed 'Best First'.
Re^3: OO-style modifiers for 'sub' ?
by Aristotle (Chancellor) on Jan 27, 2003 at 11:14 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://230141]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2017-11-25 08:39 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (355 votes). Check out past polls.