Bogdan Constantinescu
Bogdan Constantinescu

Reputation: 5356

RESTful Zend Framework API

I'm developing a Zend Framework based application and I found myself writing a skeleton for the API module. I read a bit on the web and I started writing the skeleton based on Zend_Rest_Controller. Turned out ok, key login required to use the API.

The questions started when a colleague of mine started implementing the skeleton in a proper API for one of our applications. He told me he thinks it would be better if we only had an usual Zend_Controller_Action extended in an API controller and in indexAction a Zend_Rest_Server that handles the object.

I'm a bit confused about this. From my personal point of view I'd want to have a "larger-than-average" controller containing each of the 4 actions (get, post, put, delete) and a bit of logic in each action rather than one action ruled by Zend_Rest_Server.

My problem is that I can't figure which of the 2 solutions is better from an architecture point of view; and of course, the most easily maintainable over time.

Upvotes: 7

Views: 2382

Answers (2)

Darrel Miller
Darrel Miller

Reputation: 142242

If you want to do REST on Zend I suggest you take a look at the Resauce Framework

Upvotes: 1

timdev
timdev

Reputation: 62914

Zend_Rest_Server is generally considered deprecated in favor of Zend_Rest_Controller/Zend_Rest_route. See this post by MWO'P, for instance.

This alone would push me firmly in the direction of Zend_Rest_Controller/Zend_Rest_Route.

Upvotes: 5

Related Questions