[TYPO3-mvc] @dontpersist
Felix Oertel
mehl at foertel.com
Fri Jul 16 00:51:04 CEST 2010
Hey ho,
Am 15.07.10 12:41, schrieb Bastian Waidelich:
>> what do you guys think about an "@dontpersist" annotation on domain
>> models to prevent them being persisted automatically
> I wouldn't put that information in the model. If at all, that should
> rather be an annotation in the controller / action.
I don't think the controller should care wether the model object gets
persisted or not.
>> In the very most of my extensions I don't have user input in the FE at
>> all and thus don't need auto-persistence.
> But objects are only persisted if they were changed anyways.. Why do you
> need this feature? Performance?
Performance is the one big thing. If I - in my hole plugin - don't want
to persist things, I could save time by ommitting the persistAll()
procedure.
The other is usability of the model objects. Sometimes I want to do some
stuff (like changing the tstamp before outputting or remove some
children objects from a property's objectStorage). At the moment I have
to clone the model objects for that to prevent the changes to be
persisted. This costs additional memory and time as well.
regards, foertel
More information about the TYPO3-project-typo3v4mvc
mailing list