[TYPO3-ect] tcaObjects WAS: MVC Project
Michael Scharkow
michael at underused.org
Tue Feb 7 08:59:09 CET 2006
Elmar Hinz wrote:
> * They can't build detailed complex joins themslevs, but thay could pack the
> results of join queries. That is the reason why they only can be one part of the
> model with complex queries.
As Jeff wrote, you can and should always subclass from tcaboj if you
need additional functionality. Complex queries always need to be added
manually, so this is not specific to tcaobject.
> * You could use them for 100% of TYPO3 BE form and for 80% - 95% of TYPO3 FE
> forms, but there keeps a rest, where it comes to comples joins.
The goal is to use them always 100% for querying the *interface* to
build forms from. As I see it, tcaforms are the instances of TCA-defined
arrays. If you add you special join to it, chances are you must also
define a special form input.
> * Because they mix aspects of model and view they don't really match
> requirements of a clean MVC architecture. They are rather like direct pipes
> between model and view, limited to one table each.
No, they are not. You really should look into ActiveRecord. TCAobjects
are just models: They have a defined structure and some attributes that
they themselves validate. They are only exposing that data for use in
the view.
> * If they are used both in model and view, you can't simply exchange the view or
> the model angainst another one. There isn't a typical interface between model
> and view.
See above. No view attached to an object (although TCA is violating this
principle by palette definitions, etc.), but you can attach an object to
a view. If you have a public interface, another class like TCAforms can
render a form according to the TCAobj definition.
$user = new TCAobj('fe_users',3);
$form = new TCAform(&$user);
$form->render();
TCAobject is *not* relying on anything but TCA, but could of course,
once it has a stable API, be used to do a lot of fancy stuff.
Concerning the view: I'm looking forward to a pluggable template API,
but since TCAobject only exposes data arrays, we're pretty flexible with
rendering.
Greetings,
Michael
More information about the TYPO3-team-extension-coordination
mailing list