[Solar-talk] Sungrazr_Server: Request for comments

Rodrigo Moraes rodrigo.moraes at gmail.com
Sun Mar 9 14:54:41 CDT 2008


Hey, I'm back again with an idea, after playing with the server
classes for a while. :-)

Here's the issue: Sungrazr_Server requires that you define a bootstrap
for a server type: currently JsonRpc is available, and then there are
skeletons for XmlRpc and Rest. If someone wants to setup a server to
handle both XML-RPC and REST, two bootstraps are needed.

I was thinking if it would make sense to have something more like the
front/page controllers: take a request and instantiate a class to
handle it, which could be a class of type JsonRpc, Rest, etc. The
class would read the requested action, and return a response to the
'front'. Maybe even Solar_Controller_Front could be used as the main
controller. I think this would work:

   * Solar_Controller_Front: given a uri spec, instantiates a
Vendor_Api_* class (which would extend one of the server flavors:
JsonRpc, Rest etc)
   * Vendor_Api_* class reads the requested uri and executes its
'action', returning a response to the front.
  * The front echoes the response.

This way:
  * a single bootstrap is needed for a server setup to handle
different server types.
  * an adapter is no longer needed for the server.
  * a handler base class is no longer needed either.
  * the front-server couple works much like the current front-page
classes. Server acts as a simplified page controller.

I'd suggest to have Sungrazr_Controller_Server as a base class, and
then the extended Sungrazr_Controller_Server_JsonRpc etc. Our
Vendor_Api classes would extend one of these server flavors.

What do you think? Do you see any problems or benefits with this approach?

And well, sorry if this makes no sense. I'm really new to this subject. :-)

-- rodrigo


More information about the Solar-talk mailing list