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_Feed_Writer Component Proposal

Proposed Component Name Zend_Feed_Writer
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Feed_Writer
Proposers Pádraic Brady
Revision 0.1 - 08 July 2009 (wiki revision: 2)

Table of Contents

1. Overview

Why Propose A Replacement For Zend_Feed's Feed Creation Features?

Back in 2008, I proposed Zend_Feed_Reader as a means to layer a user friendly API on top of Zend_Feed when consuming feeds. In a short time, the proposal evolved after more and more Zend_Feed inconsistencies were discovered. For example, there was no consistent API once you left the basic usage, namespaces were not handled on the DOM correctly, RDF support was non-existent (even now it's added by way of a patch which messes with the RSS namespaces), and in brief it forced developers to write an abstraction layer on top of it to make it work.

Zend_Feed_Reader took a different approach, targeting an implementation which used the DOM and XPath queries coupled with an internal implementation which was capable of understanding the various RSS and Atom standards. This was all built around a simple intuitive and extendable API to eliminate the guesswork users needed as well as the need to implement abstraction layers which differed wildly across projects. Zend_Feed_Reader is now a standalone component with no ties to Zend_Feed.

Zend_Feed_Writer follows an identical ideology - focusing on getting the job done with minimal effort using as simple an API as possible. The component should eliminate any tasks needed to transfer your data into an Atom 1.0 or RSS 2.0 feed. And it should do this while maintaining a rigorous and unforgiving adherence to standards.

The main differences from Zend_Feed will be very obvious. Zend_Feed_Writer will present a fixed method based API which must be clearly defined either in the core classes, or the set of currently loaded Extensions. These will help define namespaces, element positioning, and actively prevent the construction of malformed feeds. Two initial standards will be enforced: RSS 2.0 (including all current RSS Advisory Board recommendations) and Atom 1.0. The full range of Atom 1.0 will be available, as standard, as an RSS Extension where warranted (e.g. including URI's for an RSS feed's source XML). This will contrast with Zend_Feed's reliance on chained property assignments which require greater knowledge of the standards, and are not easily reduced to common steps for both RSS and Atom.

Zend_Feed_Writer will not utilise templating. Templating is a fast, effective solution for building feeds but it's also restrictive, encourages assumptions as to namespaces and positioning, and relies on templated strings which are prone to error and add to maintenance problems. Instead, Zend_Feed_Writer will build its feeds from scratch using the PHP DOM. DOM access will be available at all levels for manipulation outside of Zend_Feed_Writer (just as Zend_Feed_Reader offers easy access to Feed/Entry level DOMElement objects). It also ensures user Extensions have complete access to manipulate a feed in progress as needed.

In short, Zend_Feed_Writer is the obvious missing partner to Zend_Feed_Reader, completing support for consuming and building feeds.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • MUST understand the valid structure of RSS 2.0 and Atom 1.0 documents
  • MUST enforce valid structures raising Exceptions on illegal actions or when missing elements are detected
  • MUST allow the API to be extended via Extensions
  • MUST present an API which is consistent whether the feed being built is RSS or Atom
  • MUST expose the underlying parent DOMDocument or DOMElement object for external manipulation
  • MUST be capable of importing Zend_Feed_Reader objects for manipulation/editing

4. Dependencies on Other Framework Components

Zend_Http_Client
Zend_Cache
Zend_Loader_PluginLoader

5. Theory of Operation

6. Milestones / Tasks

  • Milestone 1: Publish and have proposal approved with Zend comments to resolve
  • Milestone 2: Complete initial component with unit tests
  • Milestone 3: Complete testing against a selection of web-based/desktop feed readers
  • Milestone 4: Verify that code operates under PHP 5.3/6.0-dev
  • Milestone 5: Complete documentation

7. Class Index

  • Zend_Feed_Writer
  • Zend_Feed_Writer_FeedInterface
  • Zend_Feed_Writer_Feed_Rss
  • Zend_Feed_Writer_Feed_Atom
  • Zend_Feed_Writer_EntryInterface
  • Zend_Feed_Writer_Entry_Rss
  • Zend_Feed_Writer_Entry_Atom
  • Zend_Feed_Writer_Extension_FeedAbstract
  • Zend_Feed_Writer_Extension_EntryAbstract
  • Zend_Feed_Writer_Extension_DublinCore_Feed
  • Zend_Feed_Writer_Extension_DublinCore_Entry
  • Zend_Feed_Writer_Extension_Atom_Feed
  • Zend_Feed_Writer_Extension_Atom_Entry
  • Zend_Feed_Writer_Extension_Content_Entry
  • Zend_Feed_Writer_Extension_WellFormedWeb_Feed
  • Zend_Feed_Writer_Extension_Slash_Entry
  • Zend_Feed_Writer_Extension_Syndication_Feed

Others may be determined during development

8. Use Cases

Use cases are currently being drafted.

9. Class Skeletons

Skeleton Classes will be published shortly. Please see Zend_Feed_Reader's application of Extensions, and it's API style as a similar related component.

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

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