[TYPO3-mvc] Where to implement the business logic?

Jochen Rau jochen.rau at typoplanet.de
Wed Nov 4 09:29:46 CET 2009


Hi Helmut.

Helmut Hummel wrote:
> while reading Olis post about implementing domain models (BE users etc.)
> in his recent post, I thought about my typo3_webservice extension where
> I implemented a general "model class" for all tables defined in TCA.

In Extbase we use a flavour of models called Domain Models. They hold 
the business logic (and only the business logic). A generic class 
granting access to a database table (table data gateway) has IMO several 
disadvantages.

> I thought about porting the typo3_webservice extension to make use of
> extbase, but I wonder where I can put my buisiness logic then.
>
> Currently I put it in the model class, so that I can access data of the
> objects (mainly the fields from a table row) but these objects do a lot
> more like returning a XML representation of the data and returning
> labels of the fields and so on.

Returning a XML representation, and labeling should be handled by the View.

> While porting to extbase I'd like to seperate these things, meaning
> having objects containig data but also objects implementing the business
> logic (XML transformation and the like in case of the webservice).

The controller is responsible for selecting the "right" portion of data 
and handing it over to the view (but it is not responsible for fetching 
the data from the database). The process is "configured" by the Request. 
Finally, it passes the right Response to the client.

> Can anyone give me a hint where to generally put the business logic in
> case of an extbase extension.

Regards
Jochen


-- 
Every nit picked is a bug fixed



More information about the TYPO3-project-typo3v4mvc mailing list