public function run() { $request = Request::fromServer(); $response = $this->execute($request); // In a real scenario, there would be some logic to choose the view // depending on request and response. $view = new JSONView(); $view->render($response); }