View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}



1.1 - 8 November 2006: Updated from community comments.


Zend_CommonInterface is a domain that will server to host common interfaces that framework components can
implement to insure proper coupling without using simply convention or guesswork.


* [Interfaces|]
* [Countable|]


This domain allows compontents to implement common intefaces to ensure that when optional coupling of components is a nessessity, that certain method expectations can be met.

Consider the following example: Zend_Auth needs to be able to use a persistent storage module for keeping identity stored accross multiple requests. One option for the web arena is Zend_Session. But, perhaps the developer wants to implenent this in a file, or in the registry for a desktop app or somethign similar. Or, the devloper wants to use some kind of central server and home grown cookie implementation ot handle his persistent storage needs. In this case, Zend_Auth would need to use some kind module that implements a common interface.. In this particular example, the common interface would be a "Container" or a "Persistent Storage Container".

As we start drilling down into more specific components as they relate to the MVC paridigm, common interfaces are going become more important if we want to keep the level of coupling between modules low.


* none

They are only interfaces

* Milestone 1: [design notes will be published here|]
* Milestone 2: ?
* Milestone 3: ?


* Zend_CommonInterface_Container

class Zend_Session implements Zend_CommonInterface_Container { ... }

Zend_Auth_Session extends Zend_Session { ... }

// by default Zend_Auth would use Zend_Auth_Session, but to illustrate:
Zend_Auth::setStorageModule(new Zend_Auth_Session());

// in Zend_Auth
public static function setStorageContainer(Zend_CommonInterface_Container) { ... }

// now the developer can optionally use another module for storage, perhaps My_HashObject which implements Zend_CommonInterface_Container
Zend_Auth::setStorageModule(new My_HashObject(...));



interface Zend_CommonInterface_Container
public function __get($name);
public function __set($name, $value);
public function __isset($name);
public function __unset($name);