[TYPO3-mvc] Interfaces or abstract classes as action arguments?

Martin Kutschker masi-no at spam-typo3.org
Fri Jul 2 12:59:59 CEST 2010


Am 02.07.2010 12:12, schrieb Dennis Ahrens:
> Hi Masi,
> 
> Martin Kutschker wrote:
>> Without single table inheritance it won't work (my experience). eg I had an extension that extended
>> the class, so I had to overwrite all actions in my own controller just to get the right model. I'm
>> not happy with the proposition to pass in the class name to the controller. A simple extension of
>> the base class (*no* single table inheritance) could be configured in TS. Are there other uses cases
>> then single table inheritance?
> 
> E.g.:
> 
> You want to write a controller that renders a history for several records.
> 
> Than the showAction should look like this (if we want to handle each object model).
> 
> public function showAction(Tx_Extbase_DomainObject_AbstractEntity $object) {
>     // whats done here is not relevant
> }
> 
> I see many use cases where it would be nice to write actions that handle objects of a type defined
> as abstract class or interface. Actually you can realize this only by handing over classname and uid
> to the action and doing the object reconstruction by yourself inside the action. IMO it would be
> nice if the controller can take care of this features when doing the mapping of the GET/POST
> arguments to the action method arguments.

Now I see. I cannot imagine any other solution then you suggest for this use case.

Masi


More information about the TYPO3-project-typo3v4mvc mailing list