Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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 */


Comment on Re: Re: OO-style modifiers for 'sub' ?
Download Code
Re^3: OO-style modifiers for 'sub' ?
by Aristotle (Chancellor) on Jan 27, 2003 at 11:14 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://230141]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-08-22 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (156 votes), past polls