-
Notifications
You must be signed in to change notification settings - Fork 3
Controllers
neoneo edited this page Sep 1, 2012
·
3 revisions
Controllers are the components that know where to get data from, and pass this on to the view for rendering.
There is only one instance of each controller. This means that the controller has no state pertaining to the request. Its state is shared among all requests during the life of the context instance (which keeps them).
The controller contains event handlers, which are called by the context according to its configuration. The handler receives one argument: an event object. This object exposes some methods and contains all the information that was put on it by previous tasks or the context. The event handlers perform some action and (optionally) put results back on the event, which makes it available to subsequent tasks.