This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Main Simplify.Web principles
Alexanderius edited this page Sep 12, 2019
·
8 revisions
Uses MVC pattern
- It has controllers (which processes HTTP request);
- Views (which generates page content (not needed for small pages, because StaticTpl controller response or Tpl controller response can be used)); Or just view model classes used by API controllers to generate JSON responses or create a view models from JSON requests;
- Model - your entity classes.
Uses MVVM pattern
- Controllers can create view model based on HTTP request using
Controller<T>
AndAsyncController<T>
controllers base classes andModel
property in them; - Can serialize view model to HTTP response body.
- Simplify.Web receives incoming HTTP request;
- Creates instances of controllers (which can handle current request) via Simplify.DI IOC container;
- Executes controllers instances;
- Processes controllers responses;
- Builds page:
- Loads
Master.tpl
template; - Inserts data from
DataCollector
class to it; - Sets Simplify.Web variables;
- Loads
- Sends generated page to client.
- If controller returns
Redirect
,Ajax
,Json
,StatusCode
responses then the 5 and 6 step will be skipped; - If current request is a request for static file and it is available for process (exists), then it will be processed by static files request handler and the 2 step and above will be skipped. This behavior can be changed depending on how you setup your application. For example, you can enable Kestrel or IIS static files handler, then Simplify.Web will not process static files.
- If controller returns
If all you controllers will use only non-template responses (such as Json
, Ajax
, StatusCode
, Redirect
etc.) then templating engine (and all required files fot that, such as Master.tpl
) can be skipped completely.
- Getting Started
- Main Simplify.Web principles
- Simplify.Web controllers
- Simplify.Web views
- Simplify.Web templates
- Simplify.Web configuration
- Templates variables
- Static content
- Template factory
- Data collector
- String table
- File reader
- Web context
- Environment
- Language manager
- Redirector
- HTML