Requests to a koossery.MVCwin based Win application first pass through the ControllerManager object, which manages all application’s controllers. This manager parses the request and performs controller selection. The ControllerManager object selects the controller. If no controller matches, the ControllerManager throws an Exception to indicate that the controller is not found in the controller Set. If a controller is found, the ControllerManager retrieve the action. If no action is found, an exception is thrown to indicate that the action is missing. If an action is found, the ControllerManager executes the action. If no action is specified, the default “Execute” action is ran.

The ControllerManager is the entry points to the koossery.MVCwin framework. It performs the following actions:
  1. Select the appropriate controller from a set of controllers
  2. Select the target action to execute in the selected controller
  3. Call the action

Steps Description
Start the application When you start the win app, the ControllerManager is created. Application’s controllers are created and application’s view are injected into the controller manager via a DI framework (eg:Spring)
Receive a request for the win app The ControllerManager retrieves the appropriate controller from the application’s controller set.
Retrieve the action The ControllerManager retrieves the action to execute on the target controller using .NET 2.0 reflexion.
Invoke the action The ControllerManager invokes the retrieved action on the target controller.
Execute the result A typical action method might receive user input, prepare the appropriate response data, and then execute the result by returning a result type. The built-in result types that can be executed include the following: RenderViewResult (which renders a view and is the most-often used result type) and RedirectToActionResult (which executes another action of a controller).

Last edited Jun 4, 2009 at 12:44 AM by koossery, version 6


No comments yet.