<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: Peer Review: You Have Not Because You Ask Not (Requests &amp; Responses)</title>
	<atom:link href="http://www.brandonsavage.net/peer-review-you-have-not-because-you-ask-not-requests-responses/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonsavage.net/peer-review-you-have-not-because-you-ask-not-requests-responses/</link>
	<description>The personal blog of Brandon Savage. Contains entries of a personal and professional nature focusing on PHP, Apple, LAMP, MySQL and Washington, DC.</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:09:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/peer-review-you-have-not-because-you-ask-not-requests-responses/#comment-1233</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Mon, 21 Sep 2009 12:35:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=598#comment-1233</guid>
		<description>Diogo, the reason that I&#039;m returning ExceptionResponse is because I&#039;m assuming that we want to display some sort of message to the end user. I&#039;m also assuming that this class is part of a controller, which will send its output to a response formatter.

Remember that an unhanded exception will stop the processing of an application. This would result in a white screen of death. Instead, I&#039;d want to log the exception and display something to the user.

There are additional ways to handle the exceptions; you could wrap the tweet() method call in a try-catch block in another class, etc. There&#039;s no one single &quot;right&quot; way to do it in this case.

Good question!</description>
		<content:encoded><![CDATA[<p>Diogo, the reason that I&#8217;m returning ExceptionResponse is because I&#8217;m assuming that we want to display some sort of message to the end user. I&#8217;m also assuming that this class is part of a controller, which will send its output to a response formatter.</p>
<p>Remember that an unhanded exception will stop the processing of an application. This would result in a white screen of death. Instead, I&#8217;d want to log the exception and display something to the user.</p>
<p>There are additional ways to handle the exceptions; you could wrap the tweet() method call in a try-catch block in another class, etc. There&#8217;s no one single &#8220;right&#8221; way to do it in this case.</p>
<p>Good question!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diogo</title>
		<link>http://www.brandonsavage.net/peer-review-you-have-not-because-you-ask-not-requests-responses/#comment-1232</link>
		<dc:creator>Diogo</dc:creator>
		<pubDate>Mon, 21 Sep 2009 12:30:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=598#comment-1232</guid>
		<description>Why exactly are you returning ExceptionResponse instead of just throwing an exception?</description>
		<content:encoded><![CDATA[<p>Why exactly are you returning ExceptionResponse instead of just throwing an exception?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zilvinas</title>
		<link>http://www.brandonsavage.net/peer-review-you-have-not-because-you-ask-not-requests-responses/#comment-1231</link>
		<dc:creator>Zilvinas</dc:creator>
		<pubDate>Mon, 21 Sep 2009 12:26:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=598#comment-1231</guid>
		<description>*functional =&gt; integration</description>
		<content:encoded><![CDATA[<p>*functional =&gt; integration</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zilvinas</title>
		<link>http://www.brandonsavage.net/peer-review-you-have-not-because-you-ask-not-requests-responses/#comment-1230</link>
		<dc:creator>Zilvinas</dc:creator>
		<pubDate>Mon, 21 Sep 2009 12:23:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=598#comment-1230</guid>
		<description>Fixing up databases for unit tests is slow. You want your tests to execute in 2 secs so you could run them every time you press ctrl+s and you may have hundreds of those tests. And worse you may have queries that are not compatible with sqlite like MySQL date/time functions. And worse you would be testing logging and tweeting and if your test fails for logging you are not exactly sure what&#039;s not working - logging or tweeting. Meaning it&#039;s no longer a unit test and rather a functional test.

Wouldn&#039;t say propel is doing a great job with singletons :)</description>
		<content:encoded><![CDATA[<p>Fixing up databases for unit tests is slow. You want your tests to execute in 2 secs so you could run them every time you press ctrl+s and you may have hundreds of those tests. And worse you may have queries that are not compatible with sqlite like MySQL date/time functions. And worse you would be testing logging and tweeting and if your test fails for logging you are not exactly sure what&#8217;s not working &#8211; logging or tweeting. Meaning it&#8217;s no longer a unit test and rather a functional test.</p>
<p>Wouldn&#8217;t say propel is doing a great job with singletons :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/peer-review-you-have-not-because-you-ask-not-requests-responses/#comment-1229</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Mon, 21 Sep 2009 12:02:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=598#comment-1229</guid>
		<description>I would normally have injected all dependent objects, but in this case the way Propel (the ORM I&#039;m using) works it makes use of static methods. I could potentially move the business logic into the model, but as written it would be an impossible task to replace the static methods I&#039;m using with dynamic ones that could be mocked out.

That said, you can have a custom configuration, so theoretically I could create a SQLite database in memory and test using that. Propel uses a Singleton, for better or worse, making a memory-based database perfect for testing.</description>
		<content:encoded><![CDATA[<p>I would normally have injected all dependent objects, but in this case the way Propel (the ORM I&#8217;m using) works it makes use of static methods. I could potentially move the business logic into the model, but as written it would be an impossible task to replace the static methods I&#8217;m using with dynamic ones that could be mocked out.</p>
<p>That said, you can have a custom configuration, so theoretically I could create a SQLite database in memory and test using that. Propel uses a Singleton, for better or worse, making a memory-based database perfect for testing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zilvinas</title>
		<link>http://www.brandonsavage.net/peer-review-you-have-not-because-you-ask-not-requests-responses/#comment-1225</link>
		<dc:creator>Zilvinas</dc:creator>
		<pubDate>Mon, 21 Sep 2009 09:30:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=598#comment-1225</guid>
		<description>You&#039;re creating a TwitterLog instance every time you log something. TwitterLog should be injected to improve testability. TwitterLog should be mocked out to allow the class to be tested in isolation from other components.</description>
		<content:encoded><![CDATA[<p>You&#8217;re creating a TwitterLog instance every time you log something. TwitterLog should be injected to improve testability. TwitterLog should be mocked out to allow the class to be tested in isolation from other components.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk (feed is rejected)
Page Caching using apc (user agent is rejected)
Database Caching 44/51 queries in 0.030 seconds using disk
Content Delivery Network via Amazon Web Services: S3: files.brandonsavage.net.s3.amazonaws.com

Served from: www.brandonsavage.net @ 2010-07-31 11:14:57 -->