Skip to end of metadata
Go to start of metadata

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

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

Zend Framework: ZF2: Zend_Service_Flickr Component Proposal

Proposed Component Name ZF2: Zend_Service_Flickr
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/ZF2: Zend_Service_Flickr
Proposers Mickael Perraud
Zend Liaison TBD
Revision 1.0 - 10 August 2010: Initial Draft. (wiki revision: 7)

Table of Contents

1. Overview

Note
Even if you can find similarity with another proposal, this one is only designed for ZF2 with no try to maintain backward compatibility.

Zend\Service\Flickr is a component to fetch data from Flickr, using the available API.

The component is initiated to provide an user intuitive api to fetch data from Flickr. This means objects are instantiated for every user, photo, groups...

Code available
Current working implementation is hosted on a branch of my Github account: Zend\Service\Flickr.
Backwards compatibility
Because the old Zend_Service_Flickr object has a complete different strucure, keeping backwards compatibility is impossible.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will use the Flickr API to handle requests.
  • This component will be able to process authentication
  • This component will be able to find users, photos, sets, collections, groups, tags, activities, blogs, favorites, interestingness, machinetags, pandas, geolocation, comments, notes and places
  • This component will be able to write operations.

4. Dependencies on Other Framework Components

  • Zend\Service\Exception
  • Zend\Config
  • Zend\Cache
  • Zend\Loader\PluginLoader
  • Zend\Rest\Client

5. Theory of Operation

This component can be use with or without knowing Flickr API. All Flickr objects are represented as PHP classes which have methods to load associated informations (eg. user::getPhotos or photo::getOwner).
The Flickr API is called with a REST client.

With a factory method from the Zend\Service\Flickr\Flickr class it's possible to instantiate all objects.
Each object extends FlickrObject (ObjectInterface) even a FlickrCollection (CollectionInterface). A FlickrCollection is a set of FlickrObject.
There are no magic methods.
Zend\Service\Flickr uses a plugin loader (ShortNameLocater) to load classes.
These classes needs to implement the Zend\Service\Flickr\ObjectInterface.

6. Milestones / Tasks

  • Milestone 1: Design notes ready at proposers wiki
  • Milestone 2: Working prototype and associated tests ready
  • Milestone 3: Documentation ready
  • Milestone 4: Component included in the framework

7. Class Index

  • Zend\Service\Flickr\Flickr
  • Zend\Service\Flickr\ObjectInterface
  • Zend\Service\Flickr\CollectionInterface
  • Zend\Service\Flickr\FlickrObject
  • Zend\Service\Flickr\FlickrCollection
  • Zend\Service\Flickr\Exception
  • Zend\Service\Flickr\Auth
  • Zend\Service\Flickr\Bandwidth
  • Zend\Service\Flickr\People
  • Zend\Service\Flickr\Photo
  • Zend\Service\Flickr\Photos
  • Zend\Service\Flickr\Size
  • Zend\Service\Flickr\Sizes
    ...

8. Use Cases

9. Class Skeletons

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

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

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

    <p>I'm glad to see you've looked at my earlierf ZF1.x proposal! I still have a few questions / things to say <ac:emoticon ac:name="smile" /></p>

    <p>Looking at your component requirements, it looks like it's all the Flickr api offers. A noble goal, but I don't think you're able to manage it all. I think it's a better idea to make a distinguished list of requirements where you're able to extend the component in a later stadium.<br />
    The need for a good component which is capable for 99% of the functionalities at ZF2.0 release is much more required than a 100% covered api at ZF2.10.</p>

    <p>The second point is about the factory. I think it's also a good idea to set the Zend\Service\Flickr\Flickr instance per object:<br />
    $flickr = new \Zend\Service\Flickr\Flickr(array(...));<br />
    $photo = new \Zend\Service\Flickr\Photo($flickr);<br />
    It makes it more explicit than a factory for \Zend\Service\Flickr\Flickr.</p>

    <p>The last thing: if you think it's a good idea to have another developer to work on this proposal, I'm willing to help you <ac:emoticon ac:name="smile" /></p>

    1. Jul 22, 2011

      <blockquote><p>Looking at your component requirements, it looks like it's all the Flickr api offers. A noble goal, but I don't think you're able to manage it all. I think it's a better idea to make a distinguished list of requirements where you're able to extend the component in a later stadium.<br />
      The need for a good component which is capable for 99% of the functionalities at ZF2.0 release is much more required than a 100% covered api at ZF2.10.</p></blockquote>
      <p>I add element by element, if the API is not 100% covered for ZF2.0, it's not a problem in my eyes.</p>

      <blockquote>
      <p>The second point is about the factory. I think it's also a good idea to set the Zend\Service\Flickr\Flickr instance per object:<br />
      $flickr = new \Zend\Service\Flickr\Flickr(array(...));<br />
      $photo = new \Zend\Service\Flickr\Photo($flickr);<br />
      It makes it more explicit than a factory for \Zend\Service\Flickr\Flickr.</p></blockquote>
      <p>There are 2 possibilities to use this component:</p>
      <ul class="alternate">
      <li>you know the Flickr API:
      <ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
      $flickr = new Zend\Service\Flickr\Flickr(array('api_key' => 'MY-KEY',
      'secret' => 'MY-SECRET'));
      $user = $flickr->people()->findByUsername('zf.test'); // $user instanceof Zend\Service\Flickr\People
      ]]></ac:plain-text-body></ac:macro></li>
      <li>you don't know Flickr API:
      <ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
      $flickr = new Zend\Service\Flickr\Flickr(array('api_key' => 'MY-KEY',
      'secret' => 'MY-SECRET'));
      $user = new Zend\Service\Flickr\People();
      $user->setBroker($flickr);
      $user->findByUsername('zf.test');
      ]]></ac:plain-text-body></ac:macro></li>
      </ul>

      <p>This proposal is in an early stage, I will complete it in the next week after some new tests.</p>

      <blockquote><p>The last thing: if you think it's a good idea to have another developer to work on this proposal, I'm willing to help you <ac:emoticon ac:name="smile" /></p></blockquote>

      <p>You can fork <a class="external-link" href="https://github.com/mikaelkael/zf2/tree/feature/zsflickr">https://github.com/mikaelkael/zf2/tree/feature/zsflickr</a> if you want <ac:emoticon ac:name="smile" /> but I think you should wait until I complete the proposal and its possible acceptance <ac:emoticon ac:name="wink" /></p>

  2. Feb 06, 2011

    <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>