Skip to content

Instantly share code, notes, and snippets.

@xsawyerx
Created June 28, 2012 22:51
Show Gist options
  • Save xsawyerx/3014497 to your computer and use it in GitHub Desktop.
Save xsawyerx/3014497 to your computer and use it in GitHub Desktop.
Dancer design graphs
.---------.
.----------.----------| Handler |--------.--------.
| | | '---------' | |
| | | | | |
| | | | | |
v v v '-> v v
.-----. .-----. .-----. .------------. .------. .-------.
| App | | App | | App | | Serializer | | Hook | | Route |
'-----' '-----' '-----' '------------' '------' '-------'
* There is a single handler.
* The handler includes multiple apps.
* Any serializer, hook and route (and a few other components) can global.
* They affect each other. A hook affects all routes across all apps.
.--------.
| Runner |
'--------'
|
v
.--------.
| Server |
'--------'
|
.---------|---------.
v v v
.-----. .-----. .-----.
| App | | App | | App |
'-----' '-----' '-----'
|
.-------------|----------.
| | |
| | |
v v v
.------------. .------. .-------.
| Serializer | | Hook | | Route |
'------------' '------' '-------'
* A runner is a singleton since only one runner can exist at any given time.
* A server is a singleton since only one server can exist at any given time.
(a concept of multiple runners, each running multiple servers, sounds
interesting, but unfeasible at the moment)
* A server can include multiple Apps. Apps are basically packages with Dancer
code.
* Each app can include serializers, hooks, routes, and more.
* Each serializer, hook and route is confined to that app. Nothing is shared.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment