Skip to content

Main Simplify.Web principles

Alexanderius edited this page Jul 3, 2025 · 8 revisions

Main Simplify.Web principles

  • It has controllers (which process HTTP requests)
  • Views (which generate page content; not needed for small pages, because StaticTpl or Tpl controller responses can be used). Or just view model classes used by API controllers to generate JSON responses or create view models from JSON requests
  • Model - your entity classes
  • Controllers can create a view model based on the HTTP request using Controller<T>, Controller2<T>, and AsyncController<T> base classes and the Model property
  • Can serialize the view model to the HTTP response body

Simplify.Web pipeline

  1. Simplify.Web receives an incoming HTTP request
  2. Creates instances of controllers (which can handle the current request) via the Simplify.DI IOC container
  3. Executes controller instances
  4. Processes controller responses
  5. Builds page:
    • Loads the Master.tpl template
    • Inserts data from the DataCollector class into it
    • Sets Simplify.Web variables
  6. Sends the generated page to the client
  • If a controller returns Redirect, Content, Json, or StatusCode responses, then steps 5 and 6 will be skipped
  • If the current request is for a static file and it is available to process (exists), then it will be processed by the static files request handler and step 2 and above will be skipped. This behavior can be changed depending on how you set up 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 your controllers use only non-template responses (such as Json, Content, StatusCode, Redirect, etc.), then the templating engine (and all required files for that, such as Master.tpl) can be skipped completely.

<< Previous page Next page >>

Clone this wiki locally