[TYPO3-ect] tcaObjects WAS: MVC Project

Ernesto Baschny [cron IT] ernst at cron-it.de
Tue Feb 7 13:08:46 CET 2006


Jeff Segars schrieb am 06.02.2006 20:31:

>> I waited a few days, to think about the relation of MVC, tcaObjects,
>> the tca driven forms library and Ernestos proposal of using cObjects as
>> replacement of classic ###-markers.

> Thanks for the pointer to Ernesto's proposal.  It seems like his
> approach may fit very well with atcaObject-created model.

True. I would see the cObject FE-rendering for plugins which I proposed
as configurable FE-views.

>> +------------------------------------------------------
>> View:
>> +------------------------------------------------------
>>
>> * They define a part of the view. They contain informations how to
>> transform the
>> data to a human readable format and back again.
>> * They contain information how to validate inputs.

> My opinion is that tcaObjects live completely in the model.  You are
> correct that they do contain validation, but I view validation as part
> of the model (borrowing from Rails and ActiveRecord again).  Regardless
> of what view I'm accessing the data through, the same requirements for
> the model still hold so those requirments should be stored in the model.
> 
> Other than validation, are there any items in the TCA that would live in
> the view?

I think the validation and other processing from a view is handled by
the controller. This controller should: check validity of input, do its
processing and decide which is the next "view" to show.

TCAforms (view) gets information using TCAobjects (model). The form is
send to TCAprocess (controller) to process and choose the next "view" to
display.

We almost already have such a thing in place for example:

typo3/alt_doc.php for editing a record. It defines the view and the
controller, which should just be made two separate classes. Also the
controller shouldn't just re-display the view: It should REDIRECT (with
"Location"-Header) to a new view, which is a common way of handling the
problem of "double-posting" of views in web-based applications. The TCA
is just the configuration glue that holds all things together, so I
don't think there is a problem of having model, view and controller
specific items in there.


Cheers,
Ernesto



More information about the TYPO3-team-extension-coordination mailing list