News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Brandon Savage's Blog:
Peer Review You Have Not Because You Ask Not (Requests & Responses)
September 21, 2009 @ 10:07:46

Brandon Savage's latest post in his "Peer Review" series has been added to his blog today. This time he focuses on the requests and responses - modifying the sample code to make it more testable on how things are quested and the responses they give back.

There is one last area that I want to address, and this has everything to do with object-oriented principles and code reusability. For those who are familiar with OO programming, they realize that the use of classes does not make something object oriented by nature. In this final part of the series, we'll move one step closer to being object-oriented, by introducing the concepts of request and response objects.

He changes up the Twitter object to take in a HTTPRequest object (instead of creating one by itself) and to use exceptions and a "Twitter response object" to encapsulate any responses from the service making it much easier to work with and understand than just a true/false return.

0 comments voice your opinion now!
peer review request response tutorial


blog comments powered by Disqus

Similar Posts

Wan Qi Chen: Background jobs with php and resque (Series, Parts 4, 5 & 6)

NetTuts.com: HTTP: The Protocol Every Web Developer Must Know Part 1

Mike Purcell's Blog: Symfony - sfGuardPlugin - Use Email Instead of Username

NETTUTS.com: Sanitize and Validate Data with PHP Filters

Stefan Mischook's Blog: Building Objects Video (Parts 1, 2 & 3)


Community Events





Don't see your event here?
Let us know!


symfony framework voicesoftheelephpant language release introduction version podcast install opinion package tool series security community laravel composer library interview update

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework