From 1eb5f0a07e5accd6b4c45b180ea3f0a799d96171 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 18 Nov 2017 11:48:05 +0100 Subject: [PATCH] Added application struct/flow --- application/app_flow.svg | 2 ++ application/structure.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 application/app_flow.svg create mode 100644 application/structure.md diff --git a/application/app_flow.svg b/application/app_flow.svg new file mode 100644 index 0000000..a9d9497 --- /dev/null +++ b/application/app_flow.svg @@ -0,0 +1,2 @@ + +
User
User
Http Request
Http Request
WebApp
WebApp
???
Application
???<br>Application
Router
Router
Dispatcher
Dispatcher
Modules /
Controller
[Not supported by viewer]
Mapper
Mapper
Database
Database
View
View
Template
Template
Response
Response
\ No newline at end of file diff --git a/application/structure.md b/application/structure.md new file mode 100644 index 0000000..74c906b --- /dev/null +++ b/application/structure.md @@ -0,0 +1,30 @@ +# Application Structure & Flow + +The user request gets passed through the entire application to all modules. The same goes for the response which gets created at the beginning and passed through the application to be filled. The `WebApplication` automatically forwards the user request to the correct application e.g. `Backend`. Inside the application the user request gets routed and the routes are forwarded to the dispatcher which resloves the routes. + +The routes usually reference endpoints in the module `controllers` which collects the model data through the model `mapper` and creates a partial response `view` with an assigned `template` and the collected model data. + +

Application Flow

+ +In the following only the WebApplication and Application are mentioned as the other components are explained in detail in their respective documentation. + +## WebApplication + +The `WebApplication` has a very limited purpose. It only initializes the user request and the empty response object. Additionally the WebApplication also initializes the `UriFactory` based on the user request and forwards the request to the corcect application. The result of the application is finally rendered in the WebApplication. + +## Application + +The `Application` workload depends heavily on the type of the application but in general it initializes: + +* Localization +* Database +* Router +* Dispatcher +* ModuleManager +* Cache +* Account Manager +* Event Manager +* App Settings +* Page View + +Furthermore the Application also performs a `CSRF` check, defines the `CSP`, authenticates the user and handles global errors such as invalid application permission, database connection error etc. \ No newline at end of file