Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Main Simplify.Web principles

Alexanderius edited this page Sep 12, 2019 · 8 revisions

Main Simplify.Web principles

  • 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.
  • Controllers can create view model based on HTTP request using Controller<T> And AsyncController<T> controllers base classes and Model property in them;
  • Can serialize view model to HTTP response body.

Simplify.Web pipeline

  1. Simplify.Web receives incoming HTTP request;
  2. Creates instances of controllers (which can handle current request) via Simplify.DI IOC container;
  3. Executes controllers instances;
  4. Processes controllers responses;
  5. Builds page:
    • Loads Master.tpl template;
    • Inserts data from DataCollector class to it;
    • Sets Simplify.Web variables;
  6. 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.

Simplify.Web as an API backend

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.

<< Previous page Next page >>

Clone this wiki locally