On Mon, Dec 12, 2005 at 10:45:27PM -0500, [EMAIL PROTECTED] wrote:
> Of course, I could call 'editproject' from 'saveproject', but that defeats
> the modularity of the script.
Or enhances it.
A run-mode does a few things. It does some work, and then returns
results. It's best to partition those jobs. So youu might have:
sub edit_mode {
my $self = shift;
$self->some_work();
return $self->edit_mode_results();
}
sub final_mode {
my $self = shift;
$self->some_other_work;
return $self->final_mode_results();
}
sub both_mode {
my $self = shift;
$self->some_work();
$self->some_other_work();
return $self->final_mode_results();
}
If you end up defining your "work" methods well, they'll be MORE
modular (less tied to a given run_mode, and thus more reusable).
Of course, I have a lot of templating work that happens at the end of a
run_mode, so it's pretty much very undesirable for me to erven think of
calling two in a row in one request.
YMMV.
--
SwiftOne / Brett Sanger
[EMAIL PROTECTED]
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]