Ferreteria/v0.6/clade/App/@thinking

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | App
Jump to navigation Jump to search

2025-03-06

Trying to figure out how execution is dispatched at present, so I can make it more sensible. For the CLI (futils) application dba, the calls in TryIt() go to these places:

| PreInputSetup  | [F]/apps/futils/src/App/WUIDL.php   | 22 |
| InterpretInput | [F]/src/App/Routed.php              | 21 |
| RenderIface    | [F]/apps/futils/src/App.php         | 20 |
| ExecuteInput   | [F]/src/App/Routed.php              | 30 |

Rethinking this... here's the list of stuff which (at first glance, anyway) seems like we might need to do:

  • 0. general setup (such as...?)
  • 1. (PreInputSetup()) UI setup (e.g. futils: read XML config)
    • WUIDL kicks the can to HomeKiosk
    • ...which is dba\Kiosk...
    • ...which does $this->ParseSpecFile() and $this->ParseInput(), the latter of which should be in Step 3.
  • 2. render input-agnostic UI stuff (app name, version, etc.)
  • 3. (InterpretInput()) read user input
    • currently does nothing -- which shouldn't be the case, but HomeKiosk is doing this in Step 1, PreInputSetup()
  • 4. (RenderIface()) render actions to be executed (based on user input)
    • App calls $this->DescribeSelf() and then HomeKiosk()->DescribeSelf()
    • $this->DescribeSelf() should be handled by step 3, "render input agnostic UI stuff"
  • 5. (ExecuteInput()) execute user actions (unless one of those actions has set a "simulate only" flag or whatever)
    • Routed App kicks the can to HomeKiosk again

I think I have to ditch Step 0, since there's no clear need for it. (Yes, I went back and renumbered everything starting at 0 so as to minimize confusion.) Now I'm going to try to think of better names for all the steps (including the ones that didn't exist before):

  1. ReadAppConfig() (fka PreInputSetup())
  2. ShowAppConfig()
  3. ReadUserCommand() (fka InterpretInput())
  4. DescribeActions() (fka RenderIface())
  5. ExecuteActions() (fka ExecuteInput())

Revised dispatch calls after changes:

(1) ReadAppConfig   | [F]/src/App/Routed/Cmd.php          | 22 |
(2) ShowAppConfig   | [F]/src/App/Routed/Cmd.php          | 27 |
(3) ReadUserCommand | [F]/src/App/Routed.php              | 21 | - previously did nothing; now punts to Kiosk:ReadInput()
(4) DescribeActions | [F]/src/App/Routed/Cmd.php          | 32 |
(5) ExecuteActions  | [F]/src/App/Routed.php              | 30 |

Related:

| DescribeSelf    | [F]/apps/futils/src/App.php         | 30 |
| Go              | [F]/src/App.php                     | 32 |
| GoDirectly      | [F]/src/App.php                     | 38 |
| GoWithCatch     | [F]/src/App.php                     | 42 |
| HomeKiosk       | [F]/src/App/Routed.php              | 16 |
| KioskClass      | [F]/apps/futils/src/Sys/dba/App.php | 10 |