Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Event Component Proposal

Proposed Component Name Zend_Event
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Event
Proposers Alvar Vilu
Zend Liaison TBD
Revision 1.0 - 2 December 2009: Initial Draft. (wiki revision: 9)

Table of Contents

1. Overview

Zend_Event is AS3'like powerful event system.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

Most requirements take the form of "foo will do ...." or "foo will not support ...", although different words and sentence structure might be used. Adding functionality to your proposal is requirements creep (bad), unless listed below. Discuss major changes with your team first, and then open a "feature improvement" issue against this component.

  • This component will correctly reads a developers mind for intent and generate the right configuration file.
  • The generated config file will not support XML, but will provide an extension point in the API.
  • This component will use no more memory than twice the size of all data it contains.
  • This component will include a factory method.
  • This component will not allow subclassing. (i.e. when reviewed, we expect to see "final" keyword in code)
  • This component will only generate data exports strictly complying with RFC 12345.
  • This component will validate input data against formats supported by ZF component Foo.
  • This component will not save any data using Zend_Cache or the filesystem. All transient data will be saved using Zend_Session.

4. Dependencies on Other Framework Components

  • Zend_Exception

5. Theory of Operation

This component can handle event listeners per obj or per stack trace.

6. Milestones / Tasks

zone: Missing {zone-data:milestones}

7. Class Index

  • Zend_Magic_Exception
  • Zend_Magic (factory class)
  • Zend_Magic_MindProbe
  • Zend_Magic_MindProbe_Intent
  • Zend_Magic_Action
  • Zend_Magic_CodeGen

8. Use Cases

UC-01

require_once 'Zend/Event/Dispatcher.php';

class example_event extends Zend_Event
{

const EXAMPLE = 'example_example';

public $example_var;

public function __construct ( $type, $bubbles = false, $cancelable = false, $example_var )

Unknown macro: { //construct the parent parent}

public function cloneEvent ( $eventPhase, $target, $currentTarget )

Unknown macro: { $evt = parent}

}

class disp1 extends Zend_Event_Dispatcher
{

function __construct ( ) {

//we set up a event listener for event 'loaded' and handle them in listener function
$this->addEventListener ( example_event::EXAMPLE, array (
$this,
'listener'
) );

//now we make 10 disp2 objects
for ( $i = 0; $i < 10; $i++ )

Unknown macro: { new disp2 ( ); }

}

public function listener ( Zend_Event $event )

Unknown macro: { echo $event; /* * if that event is stoppable, i could stop it on this branch or stop * it immediately, so it will not bubble further up to (main) */ }

}

class disp2 extends Zend_Event_Dispatcher
{

public function __construct ( )

Unknown macro: { $evt = new example_event ( example_event}

}

$d = new disp1 ( );

9. Class Skeletons

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.