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.