Categories


Loading feed
Loading feed
Loading feed

Matthew Weier O'Phinney Talks About Zend_XmlRpc_Server


Framework Guru and all around nice guy Matthew Weier O’Phinney wrote a post on this blog about the Zend_XmlRpc_Server that he and Davey Shafik have been working on. Let’s sneak a peek at what he had to say. (Disclaimer: Just so everyone knows, Matthew is a fellow Zendiac. It’s not something we are ashamed of but we don’t often mention it.)

In the past couple weeks, I’ve refactored it to push the class/function reflection into Zend_Server_Reflection, and, in doing so, noted that there were further areas for refactoring into additional helper classes. Currently, it now has classes for the Request, Response, and Faults, and all actual XML wrangling is done in those, making the server basically XML-agnostic.

One side benefit of this refactoring was that it allowed me to write tests much more quickly and easily. I no longer needed to worry about adding helper methods to the server in order to determine if it properly parsed the request to get the method call and arguments; I could simply test the public API for actually handling the requests. And I no longer needed to create XML in order to test the server; I could simply populate a request object in order to pass in the request, and check the response object to see if I received an appropriate value. No XML wrangling!

Speaking as the president of the “I hate XML wrangling” club, I do appreciate the effort.

Matthew goes on to give an example of how to use the new code and discusses how he thinks the code could be used as a scaffolding for other services besides just XML. If you are keeping an eye on the Zend Framework then you don’t want to miss this article.

For those of you attending ZendCon this year, Matthew and ex-Zendiac Mike Naberezny will be presenting the tutorial Best Practices of PHP Development on Monday.

=C=

Comments


Loading feed