<?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: Looking At Abstraction &#8211; Redux</title>
	<atom:link href="http://www.brandonsavage.net/peer-review-looking-at-abstraction-redux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonsavage.net/peer-review-looking-at-abstraction-redux/</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-looking-at-abstraction-redux/#comment-1056</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Mon, 31 Aug 2009 21:56:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=590#comment-1056</guid>
		<description>That&#039;s certainly a valid option as well. In fact, Propel offers the ability to customize some of the functions in the data model, which is where I might put some of this logic.</description>
		<content:encoded><![CDATA[<p>That&#8217;s certainly a valid option as well. In fact, Propel offers the ability to customize some of the functions in the data model, which is where I might put some of this logic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.brandonsavage.net/peer-review-looking-at-abstraction-redux/#comment-1054</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 31 Aug 2009 14:35:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=590#comment-1054</guid>
		<description>What about setting up a storage adapter? (not sure if that&#039;s the right pattern name...)

But basically, something like:

$twitter = new Twitter;
$twitter-&gt;setStorage(new Twitter_Storage_Propel());
....
protected function already_tweeted($message){

$hash = md5( date(&#039;Y-m-d&#039;) . $message);

$storage = $this-&gt;getStorage();

if($storage-&gt;messageExists($message)){
return true;
}
try{
$storage-&gt;save($message, $hash);
}catch($e Exception){
throw new Exception(&#039;There was an error in saving the item.&#039;);
}
return false;
}

Yes, it adds even another layer of abstraction, but that way the Twitter class doesn&#039;t have to know anything about how to save the message, and instead passes that on to the storage class.</description>
		<content:encoded><![CDATA[<p>What about setting up a storage adapter? (not sure if that&#8217;s the right pattern name&#8230;)</p>
<p>But basically, something like:</p>
<p>$twitter = new Twitter;<br />
$twitter-&gt;setStorage(new Twitter_Storage_Propel());<br />
&#8230;.<br />
protected function already_tweeted($message){</p>
<p>$hash = md5( date(&#8216;Y-m-d&#8217;) . $message);</p>
<p>$storage = $this-&gt;getStorage();</p>
<p>if($storage-&gt;messageExists($message)){<br />
return true;<br />
}<br />
try{<br />
$storage-&gt;save($message, $hash);<br />
}catch($e Exception){<br />
throw new Exception(&#8216;There was an error in saving the item.&#8217;);<br />
}<br />
return false;<br />
}</p>
<p>Yes, it adds even another layer of abstraction, but that way the Twitter class doesn&#8217;t have to know anything about how to save the message, and instead passes that on to the storage class.</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.020 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 10:47:41 -->