-- Greg Donald <[EMAIL PROTECTED]> wrote
(on Thursday, 24 April 2008, 12:53 PM -0500):
> On 4/24/08, till <[EMAIL PROTECTED]> wrote:
<snip>
> > Let alone the other methods mentioned in the docs, such as access
> > methods (as object, as array).
>
> There is absolutely nothing in Zend_Registry that can't be done with
> smaller syntax and less overhead using just PHP arrays. It's
> pointless.
Actually, there *is* stuff you can do with Zend_Registry by extending
it, such as lazy-loading and instantiating classes, etc. As an example,
I've seen people add these later capabilities to get(), so that you
don't even need to instantiate the object and push it to the registry:
$view = My_Registry::get('Zend_View'); // instantiates and loads on demand
This would simply not be possible with globals.
True, we don't offer it in ZF by default, but Zend_Registry provides an
interface that you can extend to offer this functionality.
<snip>
> > 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.
>
> Preference to less overhead shouldn't ever be a preference, it should
> be job #1 on any developer's mind. Less code, not more, faster code
> not slower. OO for the sake of OO is a waste of resources.
And unmaintainable code is one of those considerations as well. Sure,
you can grep for globals, but this does not solve the issue of
determining where they were set and under what circumstances.
Please, stop the arguments. I've already mentioned that if you don't
like Zend_Registry or see the purpose, you don't need to use it. This is
a pointless argument; we're not getting rid of the component.
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/