#013218: Add lazy initialization to PersistentObject component

Description:

Add lazy initialization to PersistentObject component like in the database component.


Environment:

Operating System:
PHP Version: (please be specific, like '4.4.3' or '5.1.5')
Database and version:
Browser (and version):


- Attachments

No attachments for this issue.


- Comments

Could you please offer any insights on how this could work, and when/how it is useful?

#257141 by Derick Rethans on June 23rd, 2008 [Permanent Link]

If you don't want to init the po session in general and also don't want to track where you use it (and then manually instatiate it). With lazy initialization I can just use it in a gateway class and don't have to care about the PO session.

Before throwing the exception for an unknown session in ezcPersistentSessionInstance::get() a check for the callback should be performed.

Together with the lazy initialization of the Db component this would be possible:

class customLazyPersistentSessionConfiguration implements ezcBaseConfigurationInitializer
{

public static function configureObject( $instance )
{
$session = new ezcPersistentSession(
ezcDbInstance::get(),
new ezcPersistentCodeManager( '../persistent' )
);
return $session;
}
}

#257142 by Andreas Schamberger on June 23rd, 2008 [Permanent Link]

Implemented in rev. 8527.

#257269 by Derick Rethans on July 3rd, 2008 [Permanent Link]

- History
Properties
Type Enhancement
Priority Medium
Component Components » PersistentObject
Affects Unknown
Fix Version 2008.2alpha1 - eZ components 2008.2alpha1
Reporter Andreas Schamberger
Responsible Derick Rethans
Status 0 Closed
Resolution Implemented
Created June 18th, 2008
Updated July 3rd, 2008
Resolved July 3rd, 2008
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #015537
  Graph shows to small and truncated rotated axis labels