[TYPO3-50-general] [TYPO3-ect] TYPO3 5.0 and lib/div/registry/orm/world domination

Elmar Hinz elmar07 at googlemail.com
Sat Aug 18 13:25:10 CEST 2007


Hello Robert,

many thanks for the full overview from side of the v5 team. It will help us
in many points to keep on the right track between v4 and v5. I will need
some time digest and update for myself all points and will probably answer
in pieces.

There is one point which is unclear for me. Either I don't understand you
completely or there is some danger in the current approach, wich needs to
be adapted.

> 
> A Controller will usally be an ActionController. It is responsible to
> decide about what actions to take and fulfill them. It aquires the
> model and - in the simpliest case - fetches a view, passes the model
> to it and adds the rendered output of the view to the Response object.
> 

Why is the response object handed to the dispatcher, the controller and the
action method? IMHO the controller should know nothing about the response
object, but simply return it's own result to parent controllers. 

> In a more sophisticated approach, the Controller does not create /
> select a view himself but rather uses a Widget to display his model.
> A Widget basically consists of a Presentation Model, a Presenter and
> a View - it generally follows the Model-View-Presenter pattern (see
> this great article for details: http://martinfowler.com/eaaDev/
> uiArchs.html). The point is that the Action Controll
> er does not know 

(He also published a "retirement note" for this pattern:
http://martinfowler.com/eaaDev/ModelViewPresenter.html)


>    /**
>     * Lists all phone book entries of our phonebook
>     *
>     * @return void
>     * @author Robert Lemke <robert at typo3.org>
>     */
>    public function action_displayPhoneBookEntries() {
>        $tableModel = $this->componentManager->getComponent
> ('T3P_Widget_ModelAdaptor_Domain2Table');
>         $tableModel->setDomainModel($this->phoneBook);
> 
>          $tableWidget = $this->componentManager->getComponent
> ('T3P_Widget_Presenter_Table');
>          $tableWidget->setModel($tableModel);
> 
>          $this->response->setData($tableWidget->render());
>     }

I would suggest the same approach like in v4:

[...]
          return $tableWidget->render();
     }

Else it will become difficult to use the hierarchical PAC pattern (HMVC). 

http://en.wikipedia.org/wiki/Presentation-abstraction-control



More information about the TYPO3-project-5_0-general mailing list