Ferreteria/v0.6/code/sys/Requests: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
No edit summary
(I don't suppose the template info disappears when the page is saved...)
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
There are (currently) the following types of request:
There are (currently) the following types of request:
* Requests to a database engine:
* Requests to a database engine:
** {{fmt/clade|Woozalia\Ferret\Sys\Data\reqs\Engine|AdminRq}} is for administration operations: backup, restore, user management, etc.
** {{fmt/clade|Sys\Data\reqs\Engine|AdminRq}} is for administration operations: backup, restore, user management, etc.
** {{fmt/clade|Woozalia\Ferret\Sys\Data\reqs\Engine|CommRq}} is for data (should probably be renamed)
** {{fmt/clade|Sys\Data\reqs\Engine|CommRq}} is for data (should probably be renamed)
* Input requests:
* Input requests:
** {{fmt/clade|Woozalia\Ferret\Sys\Events|InputReq}}
** {{fmt/clade|Sys\Events|InputReq}} [https://gitlab.com/woozalia/ferreteria/-/blob/v0.6-dev/src/Sys/Events/InputRq.md doc][https://gitlab.com/woozalia/ferreteria/-/blob/v0.6-dev/src/Sys/Events/InputRq.php code]
*** {{fmt/clade|Sys\Events\InputReq|Settable}} [https://gitlab.com/woozalia/ferreteria/-/blob/v0.6-dev/src/Sys/Events/InputRq/Settable.md doc][https://gitlab.com/woozalia/ferreteria/-/blob/v0.6-dev/src/Sys/Events/InputRq/Settable.php code]


The purpose of engine requests is to allow consolidation of all the pieces needed to perform operations ''without'' knowing what engine or connection they will be used on.
The purpose of engine requests is to allow consolidation of all the pieces needed to perform operations ''without'' knowing what engine or connection they will be used on.
Line 11: Line 12:
* At execution time, something calls <code>{{fmt/clade|Woozalia\Ferret\Sys\Events|InputReq}}->Go()</code>
* At execution time, something calls <code>{{fmt/clade|Woozalia\Ferret\Sys\Events|InputReq}}->Go()</code>
* ...which then calls the Engine object or a helper to do the operation, e.g. <code>Schema->DoImport()</code>
* ...which then calls the Engine object or a helper to do the operation, e.g. <code>Schema->DoImport()</code>
** ...which is where the thing is actually done, e.g. SQL code is sent to the DB Engine through the Connection.


...but this also happens somewhere:
...but this also happens somewhere:
* <code>{{fmt/clade|Woozalia\Ferret\Sys\Data|DbConn}}->DoAdminRequest()</code> calls <code>AdminRq->AskEngine()</code> with itself as the argument.
* <code>{{fmt/clade|Woozalia\Ferret\Sys\Data|DbConn}}->DoAdminRequest()</code> calls <code>AdminRq->AskEngine()</code> with itself as the argument.
* <code>AdminRq->AskEngine()</code> does any necessary calculations, then calls the appropriate Engine object or sub-object (e.g. Schema) to do the operation.
* <code>AdminRq->AskEngine()</code> does any necessary calculations, then calls the appropriate Engine object or sub-object to do the operation (e.g. <code>Schema->DoExport</code>).

Latest revision as of 15:58, 11 March 2025

Request subsystems

There are (currently) the following types of request:

The purpose of engine requests is to allow consolidation of all the pieces needed to perform operations without knowing what engine or connection they will be used on.

Sequence of Events

  • At execution time, something calls InputReq->Go()
  • ...which then calls the Engine object or a helper to do the operation, e.g. Schema->DoImport()
    • ...which is where the thing is actually done, e.g. SQL code is sent to the DB Engine through the Connection.

...but this also happens somewhere:

  • DbConn->DoAdminRequest() calls AdminRq->AskEngine() with itself as the argument.
  • AdminRq->AskEngine() does any necessary calculations, then calls the appropriate Engine object or sub-object to do the operation (e.g. Schema->DoExport).