On Wed, Apr 23, 2008 at 11:59 PM, Greg Donald <[EMAIL PROTECTED]> wrote: > On 4/23/08, till <[EMAIL PROTECTED]> wrote: > > Of course you can do that, but Zend_Registry for me offers the > > advantage of clean maintainable code. > > How exactly is using the existing PHP $GLOBALS variable unclean or > unmaintainable?
IMO, Zend_Registry offers a clean API that is what makes it maintainable. Some people do: if (!isset($foo['bar'])) ... if (!$foo['bar']) if ($foo['bar'] !== null) I guess there are more ways to check if "bar" exists in $foo and offering a clean approach is an advantage for me, isRegistered is exactly one. Let alone the other methods mentioned in the docs, such as access methods (as object, as array). > > Do a couple unsets to your $GLOBALS['registry'] and a dozen checks if > > a value is set, then hide it in the middle of an application and then > > let someone else figure out the code. As of when it's used, and where > > etc.. > > grep -r GLOBALS . Oh yeah, I guess you can search for everything like that. =) I mean, point taken that works for a small app, I don't wanna skim through the output of a larger one. But I guess that is totally up to what you prefer. > > In general, many things you could achieve by coding it up > > yourself, but that is not really the point of a framework. > > Zend "Components" seems a much more appropriate name since nothing is > integrated with anything else. Wrapping an OO layer around an > existing feature doesn't make it a framework. Well, yes and no. Yes, because they are already called components, and no because this type of framework is called a glue framework. Till
