[TYPO3-team-core-v5] RFC: Open question on support for associative array properties in persistence
Bastian Waidelich
bastian at typo3.org
Thu Nov 13 10:14:02 CET 2008
Karsten Dambekalns wrote:
Hi Karsten,
> Please have a look at
> http://forge.typo3.org/issues/show/1620
For me it's still a bit unclear how to handle sub-references in TYPO3CR
in general. I can't really think of a scenario where array-properties in
domain objects would make sense.. Let's take the Blog for instance:
Right now _posts_ is an array-property of _Blog_ which forces us to load
all posts into RAM to find a single post by its UUID.
And we have to instantiate a _Blog_ instance to retrieve its _posts_,
there is no "find all posts of blog xy" AFAIK.
Is there already a plan on how to overcome these issues?
And then - back to the topic - wouldn't _posts_ rather be some kind of
Collection of F3::Blog::Domain::Post, and the "array key" the identifier?
As you can see, the whole Content Repository subject is still quite
diffuse to me.
Anyway, when using arrays I'd definitely agree to Robert: If I would
forget (or didn't know about) some @preservekeys annotation this would
lead to unexpected results. And worse, it would lead to unexpected
results only in some cases.
My opinion in general: As little magic (in the sense of new concepts,
new annotations, unusual behavior) as possible.
Bastian
More information about the TYPO3-team-core-v5
mailing list