[TYPO3-mvc] Object Accessors & lazy object loading
Franz Koch
typo3.RemoveForMessage at elements-net.de
Fri Apr 8 13:32:07 CEST 2011
Hey Frank,
> that debug-Thing is obvious to me now, thx :).
when thinking about it it's probably obvious, but we need again a
working debugging solution. Have to discuss that with the others. If
anybody knows how we can hide properties from debug calls just drop a note.
> Ok, here is the fluid part:
>
> <f:for each="{heft.heftZuArtikel}" as="artikel">
>
> <h3>{artikel.artikelZuBereich.bereichDescription}</h3>
...
> <span>{artikel.artikelTitel}</span>
...
wow, you really named the properties "heftZuArtikel" and
"artikelZuBereich"? That's not very intuitive and should probably be
changed for a clean and understandable Domain language.
First, a "artikel" doesn't belong to "artikelZuBereich", but it belongs
to a single "Bereich". And inside the "Bereich" object it's obvious that
the "bereichDescription" belongs to the "Bereich", so it could be just
named "description".
So instead of {artikel.artikelZuBereich.bereichDescription} better would
be {artikel.bereich.description}. And instead of {heft.heftZuArtikel} a
{heft.articles} would be more natural.
As a rule of thumb you just have to imagine that you would personally
interact with the objects and could talk to them, and then name the
properties how you would have ask for them.
Example: You wouldn't ask a {heft} to give you all {heftZuArtikel} but
rather "Hey heft, could you give me all your articles" - so name it
"articles" (it's a bit unlucky that plural and singular are the same for
"Artikel" in German).
--
kind regards,
Franz Koch
More information about the TYPO3-project-typo3v4mvc
mailing list