> But now that we think of the get() method as static-only, as Stas points
> out there is no need to call it on an object, then get() with no
> arguments is actually equivalent to getInstance().  The getInstance()
> method doesn't need to be public at all.
>
> So the usage to get the default static registry is:
>   $r = Zend_Registry::get();

I think static ::get('foo') and ::set('foo', 'bar') methods are acceptable
compromises, but get() really shouldn't replace getInstance().  It
provides a Singleton instance.  The standard way of telling that to the
user is with the name "getInstance()".  New users who are uncomfortable
with this terminology can stick to Zend_Registry::get('foo') and
Zend_Registry::set('foo', 'bar').

> I think educating users on design patterns is a fine idea.  It would be
> great to see a series of articles on DevZone about implementing design
> patterns in PHP.  In fact, it's such a good idea that there already is
> such a series of articles on DevZone.  :-)
> http://devzone.zend.com/search/results?q=pattern
>
> But it's probably not something that needs to be in the Zend Framework
> manual.  Stas is right that the principle of extreme simplicity in ZF
> should make it unnecessary to know design patterns just to use ZF.
> Education is always beneficial, but one doesn't need to be a mechanic to
> drive a car.

I should hope developing a web application is not equivalent to driving a
car, otherwise we're all out of jobs.

USING a web application is equivalent to driving a car.  In that case, I
agree, the user should only be familiar with the basic concepts (using a
mouse and keyboard, navigating the web, using a browser).  It takes no
specialized expertise to fill out a form.  You don't have to be a
Formula-1 driver to get to the grocery store.

On the other hand, developing a web application is equivalent to building
a car from scratch.  Zend Framework simply provides the engine, wheels,
and drive train to help you do it.  You still should know how to put the
thing together.  Frankly, if you're not familiar with how brakes work,
everyone is better off if you never leave the garage.  :-)

-Matt

Reply via email to