Hello moritz, and thanks for your reply.
Why do you want to hide the object orientation from the runner scripts? If that's the most natural interface to your application, why mask it?
Well.... I did mention I was falling down a rabbit hole :) I've been seduced by scripting tools, particularly Marathon which provides extensions for Jython. I saw that, wondered a) how hard it would be and b) how it might "feel" to use it if I could do it, and decided to try. I'm not at all married to hiding the object orientation, I just thought that it might be easier for my fellow testers to write click_folder($folder_id) than $driver->click_folder($folder_id), particularly since they don't (currently) write Perl. In fact, before I go too much further, I'll probably show them sample scripts, one hiding the object orientation and another showing it, and ask them which they'd prefer to work with.
# instead of #sub value #{ # my ( $self ) = ScriptRunner->new(); # return $self->{'driver'}->value; #} sub make_wrapper { my $name = shift; return sub { ScriptRunner->new()->{'driver}->$name(@_); } } *value = make_wrapper('value'); *reset_counter = make_wrapper('reset_counter);
Thanks! I figured there had to be a better way to do what I was trying to, but couldn't come up with it. I'll also read about autoloading.
Regards,
Bald Man Tom
In reply to Re^2: On the merits of implementing a script running application
by BaldManTom
in thread On the merits of implementing a script running application
by BaldManTom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |