3
0
Fork 0

Add docs for handlers, app handler

This commit is contained in:
Lance Edgar 2023-11-24 15:49:57 -06:00
parent 6b110e567a
commit 4a7729a702
13 changed files with 153 additions and 14 deletions

View file

@ -0,0 +1,31 @@
Architecture
============
Handlers are similar to a "plugin" concept in that multiple handlers
may be installed e.g. by different packages. But whereas one might
"enable" multiple plugins, only *one* handler may be used, for a given
purpose.
There can be many "types" of handlers; each is responsible for a
certain aspect of the overall app. So it can be thought of as,
"*Which* plugin should *handle* this aspect of the app?"
What a Handler Does
-------------------
Each type of handler does something different. For instance there
might be an "auth handler" responsible for authenticating user
credentials.
The app itself will define the need for a handler. For instance if a
user login mechanism is needed, then the app might define the "auth
handler" (e.g. ``AuthHandler``) base class, and add a way to locate
and use it at runtime.
Other packages might then also define "auth handlers" derived from the
base class, and perhaps a way for the app to locate them as well.
The app should probably have a way for the "choice" of auth handler to
be configurable, and possibly expose this choice via admin UI.