[dev] [cvs] commit: framework/Prefs Prefs.php

Michael M Slusarz slusarz at mail.curecanti.org
Mon Nov 28 10:00:51 PST 2005


Quoting Jan Schneider <jan at horde.org>:

> jan         2005-11-28 02:29:06 PST
>
>   Modified files:
>     Prefs                Prefs.php
>   Log:
>   Revert 1.155. It is not the factory's job to create singletons. 
> That's what singleton() is for. Fixes partially bug 3050.
>
>   Revision  Changes    Path
>   1.157     +10 -16    framework/Prefs/Prefs.php
>
>   Chora Links:
>   
> http://cvs.horde.org/diff.php/framework/Prefs/Prefs.php?r1=1.156&r2=1.157&ty=u

You're right... but then this code needs to be put back into singleton 
and Registry::loadPrefs() needs to call singleton() not factory().  As 
discussed in my previous email, we should only be creating a new prefs 
objects for each prefs backend.  We should *not* be creating new prefs 
objects for each scope.  Updating the scope and the preferences visible 
to the scope should be something done internally by Prefs::, but there 
is no valid reason to have to create X amount of Prefs objects.  Not 
only does it take up (X - 1) times the memory, but it also causes (X - 
1) times the shutdown function is called.  Finally, and more 
importantly, caching prefs values should be done entirely in Prefs - 
doing it both in Registry and Prefs is overkill at best and sloppy at 
worse.

michael

_______________________________________
Michael Slusarz [slusarz at curecanti.org]


More information about the dev mailing list