Ferreteria/v0.5/startup: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{fmt/title|Ferreteria startup process}}
{{fmt/title|Ferreteria startup process}}
This is the chain of events that takes place, in a typical application based on caAppUser ("the App object" or just "App"), when the site is invoked (i.e. a page is requested, possibly just the front page or possibly something more specific).
This is the chain of events that takes place, in a typical application based on {{l/ver/class|caAppUser}} ("the App object" or just "App"), when the site is invoked (i.e. a page is requested, possibly just the front page or possibly something more specific).


Assuming there are no initialization problems, the {{l/ver|@cls/app|App}} object calls its <code>Main()</code> function. This then opens the database and, if successful, calls its <code>GetPageObject()</code> method to get the {{l/ver|@cls/page/page|Page}} object to use for rendering. The class to used is determined by the Ferreteria deployment's configuration, and is not (at least by default) affected by the URI data.
Assuming there are no initialization problems, the {{l/ver/class|caAppUser}} object calls its <code>Main()</code> function. This then opens the database and, if successful, calls its <code>GetPageObject()</code> method to get the Output Page (a {{l/ver/class|caWebPage}} podling) object to use for rendering. The class to used is determined by the Ferreteria deployment's configuration, and is not (at least by default) affected by the URI data.


App->Main() then calls the {{l/ver|@cls/page|Page}} object's DoBuilding(), DoFiguring(), and DoOutput() methods. Each of those then creates an appropriate {{l/ver|evint}} object and passes it to $this->DoEvent():
App->Main() then calls the Output Page object's <code>DoAllEvents()</code> method. The Output Page defines what events are needed to process input and build the output; see the Startup section in the Page object's documentation to find out what happens next.
* DoBuilding(): cEventNodeBuild
* DoFiguring(): cEventNodeFigure
* DoOutput() cRender
 
''documentation in progress''
==Changes==
==Changes==
* '''2022-06-22''' DoOutput() now ''also'' uses the evint system. Subsidiary classes need revision to be in line with this.
* '''2022-06-22''' DoOutput() now ''also'' uses the evint system. Subsidiary classes need revision to be in line with this.
** WAS: DoOutput() actually calls $this->Render() which calls $this->RenderNodes() which must be defined by the Page object. The standard implementation is to use the tRenderableTree trait, which then iterates through each sub-node... this doesn't quite make sense. At what point is the Render event created?
** WAS: DoOutput() actually calls $this->Render() which calls $this->RenderNodes() which must be defined by the Page object. The standard implementation is to use the tRenderableTree trait, which then iterates through each sub-node... this doesn't quite make sense. At what point is the Render event created?
** cEvent* classes should be renamed to remove the redundant "Event", since they're already in the ferret\evint namespace (...or possibly all the events should be in the ferret\page namespace...)
** cEvent* classes should be renamed to remove the redundant "Event", since they're already in the ferret\evint namespace (...or possibly all the events should be in the ferret\page namespace...)

Revision as of 15:40, 25 July 2022

Ferreteria startup process

This is the chain of events that takes place, in a typical application based on caAppUser ("the App object" or just "App"), when the site is invoked (i.e. a page is requested, possibly just the front page or possibly something more specific).

Assuming there are no initialization problems, the caAppUser object calls its Main() function. This then opens the database and, if successful, calls its GetPageObject() method to get the Output Page (a caWebPage podling) object to use for rendering. The class to used is determined by the Ferreteria deployment's configuration, and is not (at least by default) affected by the URI data.

App->Main() then calls the Output Page object's DoAllEvents() method. The Output Page defines what events are needed to process input and build the output; see the Startup section in the Page object's documentation to find out what happens next.

Changes

  • 2022-06-22 DoOutput() now also uses the evint system. Subsidiary classes need revision to be in line with this.
    • WAS: DoOutput() actually calls $this->Render() which calls $this->RenderNodes() which must be defined by the Page object. The standard implementation is to use the tRenderableTree trait, which then iterates through each sub-node... this doesn't quite make sense. At what point is the Render event created?
    • cEvent* classes should be renamed to remove the redundant "Event", since they're already in the ferret\evint namespace (...or possibly all the events should be in the ferret\page namespace...)