ZF-6331: Zend_Application classes violates against coding standards

Issue Type: Coding Standards Violation Created: 2009-04-16T23:12:25.000+0000 Last Updated: 2009-05-06T01:35:34.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: Jan Pieper (jpieper) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Application

Related issues: Attachments:


||current||must be|| |Zend_Application_Bootstrap_BootstrapAbstract|Zend_Application_Bootstrap_Bootstrap_Abstract| |Zend_Application_Bootstrap_Bootstrapper|something like Zend_Application_Bootstrap_Interface| |Zend_Application_Bootstrap_ResourceBootstrapper|something like Zend_Application_Bootstrap_ResourceBootstrapper_Interface| |Zend_Application_Module_Bootstrap|something like Zend_Application_Module_Bootstrap_Abstract| |Zend_Application_Resource_ResourceAbstract|Zend_Application_Resource_Abstract|

And why are there such stupid (!?) class names like following?

||current||why not ...?|| |Zend_Application_Bootstrap_Bootstrap|Zend_Application_Bootstrap| |Zend_Application_Bootstrap_BootstrapAbstract|Zend_Application_Bootstrap_Abstract|


Posted by Matthew Weier O'Phinney (matthew) on 2009-04-17T04:48:40.000+0000

We are revising the coding standards, and the new standards will be published in the manual for 1.8. There are several concerns:

  • When we move to using namespaces: ** having a final segment of just "Interface" or "Abstract" will not work, as they are reserved keywords ** the interface and the framework's concrete implementations should be in the same namespace
  • A desire to stay away from Hungarian Notation
  • A desire to comply with forthcoming PEAR2 standards: **

A summary of the new rules is as follows: * Interfaces must be named descriptively, and fall under the same namespace as implementations * Abstract classes should be named descriptively, but may include the suffix "Abstract" as part of the classname * Abstract classes must fall under the same namespace as implementations

The reason we want the interfaces/abstracts to fall under the same namespace as implementations is to make it easy to package individual components, as well as to import and alias a single namespace .

To give an example, consider the following PHP 5.3 namespace-aware implementations:

<pre class="highlight">
namespace zend\application\bootstrap;

interface Bootstrapper

abstract class BootstrapAbstract implements Bootstrapper

class Bootstrap extends BootstrapAbstract

In a userland implementation, you might have the following:

<pre class="highlight">
namespace website;
use zend\application\bootstrap as App;

class Bootstrap extends App\Bootstrap

These changes to the standards have been discussed on the zf-contributors mailing list.

Posted by Adam Weinstock (adamweinstock) on 2009-05-06T01:35:31.000+0000

Why then is Zend_Application not Zend_Application_Application?

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.