Zend Framework

Zend_Application classes violates against coding standards

Details

  • Type: Coding Standards Violation Coding Standards Violation
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Not an Issue
  • Affects Version/s: None
  • Fix Version/s: 1.8.0
  • Component/s: Zend_Application
  • Labels:
    None

Description

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

Activity

Hide
Matthew Weier O'Phinney added a comment -

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

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:

namespace zend\application\bootstrap;

interface Bootstrapper
{
}

abstract class BootstrapAbstract implements Bootstrapper
{
}

class Bootstrap extends BootstrapAbstract
{
}

In a userland implementation, you might have the following:

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.

Show
Matthew Weier O'Phinney added a comment - We are revising the coding standards, and the new standards will be published in the manual for 1.8. There are several concerns: 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:
namespace zend\application\bootstrap;

interface Bootstrapper
{
}

abstract class BootstrapAbstract implements Bootstrapper
{
}

class Bootstrap extends BootstrapAbstract
{
}
In a userland implementation, you might have the following:
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.
Hide
Adam Weinstock added a comment -

Why then is Zend_Application not Zend_Application_Application?

Show
Adam Weinstock added a comment - Why then is Zend_Application not Zend_Application_Application?

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: