If I understand your question properly you want to know why there are so
many run-modes for each step when in several cases a couple of run-modes
could be groups together as one run-mode?
The answer to this has to do with Super Classes and inheritance. In the case
of a single C:A module running on it's own your shortened version makes
sense, however, in the scope of several C:A modules running as part of a
larger system, each module might want to execute it's own code in either
cgiapp_prerun() or cgiapp_postrun() that might not be shared by other
modules.
And certainly every C:A has a unique setup() routine that defines the
run-modes for that module.
Likewise, many different modules might share the same teardown() or
cgiapp_ini() routines.
The extra "steps" are there for you to be able to easily define a more
usefull base class that you can then derive each individual module from
without having to duplicate code.
Hope that helps
---
Steve Comrie
----- Original Message -----
From: "punkish" <suppressed>
To: <suppressed>
Sent: Thursday, December 09, 2004 11:25 AM
Subject: [cgiapp] a question about the order of operations
> I read OrderOfOperations at
> http://twiki.med.yale.edu/twiki2/bin/view/CGIapp/OrderOfOperations
>
> The following is the summary of the order of ops.
>
> my $webapp = WebApp->new();
> 1. cgiapp_init()
> 2. setup()
>
> if (everything is copacetic)
>
> $webapp->run();
> 3. cgiapp_prerun()
> 4. the main instance runmode
> 5. cgiapp_postrun()
> 6. teardown()
> else
> kaboom
>
>
> so, here is my question.
>
> seems like 1 and 2 will always run in that order, and then, hopefully,
> 3..6 will always run in that order. Now, if A and B will always run in
> that order, they are really the same as AB. I can understand the point
> of separating 3, 4, and 5..6 because 3 onward will _only_ happen under
> a certain condtion (code being error free), and 4 is really
> representative of possibly many things that I might do based on one
> runmode, however, once again, if 5 and 6 are always going to run in
> that order, then they may as well be one thing.
>
> In other words, I could rephrase the above order as
>
> my $webapp = WebApp->new();
> 1. cgiapp_init_and_ setup()
>
> if (everything is copacetic)
>
> $webapp->run();
> 2. cgiapp_prerun()
> 3. the main instance runmode
> 4. cgiapp_postrun_and_ teardown()
> else
> kaboom
>
> if my logic is correct, why the verbosity. If not, please enlighten me
> and correct me as necessary.
>
>
> --
>
> punkish
>
> ---------------------------------------------------------------------
> Web Archive: http://www.mail-archive.com/suppressed/
> http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
> To unsubscribe, e-mail: suppressed
> For additional commands, e-mail: suppressed
>
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.