[TYPO3-mvc] Question about persisting valueObjects

Franz Koch typo3.RemoveForMessage at elements-net.de
Mon Jun 21 01:01:51 CEST 2010


Hey there,

just a short question about valueObjects. I just upgraded a dev-system 
to RC1/RC2 of extbase and debuged DB-handling again due to the recent 
changes/improvements on the persistence level regarding lazy objects.
By that I noticed that valueObjects seem to get persisted regardless if 
they are dirty (can they even be dirty?) or not. What's the reason for 
that? Isn't that just again a waste of valuable processing time? 
Especially because they get persisted multiple times if you're 
displaying multiple records that have the same valueObject attached.

Example:

Imagine a news or blog extension in list view. The list is displaying 20 
records. Each record has multiple tags assigned. If the same tag is 
assigned to every records, it get's persisted 20 times with the very 
same db-values.


For me this looks like a huge performance killer on bigger projects. I 
know that valueObjects don't have a identity, but can't we track the DB 
uid or something on persistence level to prevent that? Or at least only 
persist dirty valueObjects?
Having that overhead in mind I'm more and more in favor of using 
entities only (didn't get the real benefit of valueObjects anyway).

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list