[TYPO3-mvc] @dontpersist

Nicolas de Haen typo3 at ndh-websolutions.de
Wed Mar 23 07:33:48 CET 2011


Hi,

what about a situation like this: If I don't want to persist the 
probably unexact result of the location service, I have to recalculate 
the location multiple times during runtime. There is no possibility to 
set the properties just for the runtime

public function getLocation(){
    if(empty($this->lat) || empty($this->lon)){
       try{
          $lat = $this->locationService->getLat($this->address);
	 $lon = $this->locationService->getLon($this->address);
			
// this is not possible without persisting lat and lon
//	 $this->lat = $lat;
//	 $this->lon = $lon;
			
	return array($lat,$lon);
       }
       catch(Exception $e){
	// do something here
       }
    }
    return array($this->lat,$this->lon);
}

In fact the whole frontend rendering process in my Domain is "readOnly". 
All creation and manipulation is done in the backend. But extbase tries 
each time to persist all dirty objects. That's a performance issue and 
I'm restricted in my model.

Cloning doesn't help either, I would have to loop through all models, 
and if they don't have the properties lat and lon set, I have to replace 
them with a clone? That's not what we expect from a frameworks...

To me it seems a basic configuration option to switch that behaviour off...

regards,
Nico


More information about the TYPO3-project-typo3v4mvc mailing list