<ac:macro ac:name="info"><ac:parameter ac:name="title">Zend_Options</ac:parameter><ac:rich-text-body> <ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Zend_Options serves as a conceptual idea for standardizing, extending and persisting the predefined data structures of certain parameters (or simply, "the usage options") of certain Zend Framework class methods.
<ac:macro ac:name="note"><ac:parameter ac:name="title">Terminology</ac:parameter><ac:rich-text-body><p>Throughout this proposal, the word "options" is used to refer to "the expected (preconceived) data structure of the variables passed as parameters to the methods of certain Zend Framework classes".</p></ac:rich-text-body></ac:macro></ac:rich-text-body></ac:macro>
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
Zend Framework: Zend_Options Component Proposal
Proposed Component Name
Zend_Options
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_Options
Proposers
Werner Mollentze
Zend Liaison
TBD
Revision
1.0 - 20 October 2010: Initial Draft Finished.
1.1 - 20 October 2010: Ready For Review. (wiki revision: 19)Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
- Zend_Exception
5. Theory of Operation
The component attempts to address the differences in the implementation of method usage options of classes in the Zend Framework.
Usually, arrays (and sometimes instances of Zend_Config) are used to define and implement the usage options of class methods.
There is currently no standardised way to retrieve the valid (predefined) options for a given class method.
Zend_Mail_Transport_Smtp's constructor serves as a simple example of an existing Zend Framework class method that expects predefined data structures to be used as its parameters:
If Zend_Mail_Transport_Smtp had a method for defining, retrieving and governing the valid options for its constructor, its use could be simplified and predictable.
Given the Zend_Options class skeletons, Zend_Mail_Transport_Smtp could implement a getOptions() method, that returned an instance of Zend_Options.
The options for calling its constructor could then be exposed on order to be examined and modified:
Options could be assigned using instances of Zend_Options, also for different usage scenarios:
Switching between different sets of usage options could then be possible for different usage scenarios, without the need to create additional instances of a class:
If all classes use the same option interface for their methods (e.g. Zend_Options), reusing options would be more simplified, and their method parameter structures would be more predictable.
6. Milestones / Tasks
- Milestone 1: [DONE] Create class skeletons in order to be able to test feasibility.
- Milestone 2: [DONE] Publish proposal for Review.
- Milestone 3: Get input, share ideas, brainstorm. Decide whether components have a practical use in Zend Framework.
- Milestone 4: Revise proposal, approve for incubator development
- Milestone 5: Implement support for Zend_Options in constructor methods where appropriate.
7. Class Index
- Zend_Option_Exception
- Zend_Options_Exception
- Zend_Option
- Zend_Options
8. Use Cases
| UC-01 |
|---|
A simple mock class using Zend_Options to define a parameter's data structure.
| UC-02 |
|---|
Simple extension of parent class options.
| UC-03 |
|---|
Using options and option modes
3 Comments
comments.show.hideJul 11, 2010
Nick Daugherty
<p>I think this page should probably be removed...</p>
Oct 20, 2010
Werner Mollentze
<p>Indeed, my apologies. The proposal has been dormant for quite a while, but I have finally managed to get the time to add the Class Skeletons today.</p>
Feb 07, 2011
Dolf Schimmel (Freeaqingme)
<p>Archiving this proposal, feel free to recover it when you want to work on it again. For more details see <a href="http://framework.zend.com/wiki/display/ZFDEV/Archiving+of+abandoned+proposals+(Feb+5+2011)">this email</a>.</p>