<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DaveDevelopment &#187; Open Source</title>
	<atom:link href="http://www.davedevelopment.co.uk/archive/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davedevelopment.co.uk</link>
	<description>Dave Marshall</description>
	<lastBuildDate>Tue, 01 Jun 2010 13:18:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ZFSnippets.com now managed by bescript.de</title>
		<link>http://www.davedevelopment.co.uk/2010/06/01/zfsnippets-com-now-managed-by-bescript-de/</link>
		<comments>http://www.davedevelopment.co.uk/2010/06/01/zfsnippets-com-now-managed-by-bescript-de/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 13:18:41 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[zfsnippets]]></category>
		<category><![CDATA[zfsnippets.com]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=480</guid>
		<description><![CDATA[Not so long ago, I posted requesting that people who fancied maintaining ZFSnippets.com should get in touch and see if I could hand it over. Thanks to everyone who volunteered (sorry I didn&#8217;t get back to you all individually!) and eventually I decided to hand it over to German PHP outfit, bescript.de. Ben was very [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.davedevelopment.co.uk/2010/04/26/wanted-new-home-for-zfsnippets-com/">Not so long ago</a>, I posted requesting that people who fancied maintaining <a href="http://zfsnippets-com">ZFSnippets.com</a> should get in touch and see if I could hand it over. Thanks to everyone who volunteered (sorry I didn&#8217;t get back to you all individually!) and eventually I decided to hand it over to German PHP outfit, <a "href=http://www.bescript.de/">bescript.de</a>. <a href="http://twitter.com/psaxde">Ben</a> was very clear and excited in his email and after discussing it with him I knew the handover would be nice and easy and bescript.de would take good care of the site. They have already <a href="http://blog.zfsnippets.com/new-features-and-changes/">added new features</a> and ticked some items off the uservoice list!</p>
<p>Again, thanks to everyone who got in touch and best of luck to Ben and his team with the site.</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fzfsnippets-com-now-managed-by-bescript-de%2F&amp;title=ZFSnippets.com%20now%20managed%20by%20bescript.de&amp;bodytext=Not%20so%20long%20ago%2C%20I%20posted%20requesting%20that%20people%20who%20fancied%20maintaining%20ZFSnippets.com%20should%20get%20in%20touch%20and%20see%20if%20I%20could%20hand%20it%20over.%20Thanks%20to%20everyone%20who%20volunteered%20%28sorry%20I%20didn%27t%20get%20back%20to%20you%20all%20individually%21%29%20and%20eventually%20I%20decide" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fzfsnippets-com-now-managed-by-bescript-de%2F&amp;title=ZFSnippets.com%20now%20managed%20by%20bescript.de&amp;notes=Not%20so%20long%20ago%2C%20I%20posted%20requesting%20that%20people%20who%20fancied%20maintaining%20ZFSnippets.com%20should%20get%20in%20touch%20and%20see%20if%20I%20could%20hand%20it%20over.%20Thanks%20to%20everyone%20who%20volunteered%20%28sorry%20I%20didn%27t%20get%20back%20to%20you%20all%20individually%21%29%20and%20eventually%20I%20decide" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fzfsnippets-com-now-managed-by-bescript-de%2F&amp;h=ZFSnippets.com%20now%20managed%20by%20bescript.de" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fzfsnippets-com-now-managed-by-bescript-de%2F&amp;title=ZFSnippets.com%20now%20managed%20by%20bescript.de" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fzfsnippets-com-now-managed-by-bescript-de%2F&amp;title=ZFSnippets.com%20now%20managed%20by%20bescript.de" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fzfsnippets-com-now-managed-by-bescript-de%2F&amp;title=ZFSnippets.com%20now%20managed%20by%20bescript.de" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fzfsnippets-com-now-managed-by-bescript-de%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2010/06/01/zfsnippets-com-now-managed-by-bescript-de/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set MySQL connection variables with mysql-proxy</title>
		<link>http://www.davedevelopment.co.uk/2010/06/01/set-mysql-connection-variables-with-mysql-proxy/</link>
		<comments>http://www.davedevelopment.co.uk/2010/06/01/set-mysql-connection-variables-with-mysql-proxy/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 11:01:02 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[lua]]></category>
		<category><![CDATA[mysql-proxy]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=477</guid>
		<description><![CDATA[We recently moved the application I work on everyday to Amazon Web Services and bravely adopted their Relational Database Service (RDS) and have had little trouble thus far, but the other day I noticed since we kicked into BST, timestamps in the database where an hour behind. Low and behold, the default time zone cannot [...]]]></description>
			<content:encoded><![CDATA[<p>We recently moved the application I work on everyday to <a href="http://aws.amazon.com/">Amazon Web Services</a> and bravely adopted their <a href="http://aws.amazon.com/rds/">Relational Database Service (RDS)</a> and have had little trouble thus far, but the other day I noticed since we kicked into BST, timestamps in the database where an hour behind. Low and behold, the default time zone <a href="http://aws-musings.com/amazon-relational-database-service-rds-the-timezone-problem/">cannot be changed</a>. Luckily, we&#8217;ve been using <a href="https://launchpad.net/mysql-proxy">mysql-proxy</a> since we migrated and rather than changed our application, I managed to knock up a <a href="http://www.lua.org/">lua</a> script that sets the timezone variable on every query. It would be nice if it could do it when it creates a connection, but I&#8217;ve not worked out how to do that yet!</p>
<pre name="code" class="lua">
---
-- read_query() can rewrite packets
--
function read_query( packet )
        if string.byte(packet) == proxy.COM_QUERY then
                proxy.queries:append(1, string.char(proxy.COM_QUERY) .. "SET time_zone = 'Europe/London'", {resultset_is_needed = true})
                proxy.queries:append(2, packet)
                return proxy.PROXY_SEND_QUERY
        end
end

---
-- read_query_result() is called when we receive a query result
-- from the server
--
function read_query_result(inj)
        if (inj.type == 1) then
            return proxy.PROXY_IGNORE_RESULT
        end
end
</pre>
<p>If anyone could point me in the general direction for setting the variable at connection time, it&#8217;d be appreciated. I assume I can create a create_connection function, but I don&#8217;t know where to go from there.</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy&amp;bodytext=We%20recently%20moved%20the%20application%20I%20work%20on%20everyday%20to%20Amazon%20Web%20Services%20and%20bravely%20adopted%20their%20Relational%20Database%20Service%20%28RDS%29%20and%20have%20had%20little%20trouble%20thus%20far%2C%20but%20the%20other%20day%20I%20noticed%20since%20we%20kicked%20into%20BST%2C%20timestamps%20in%20the%20data" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy&amp;notes=We%20recently%20moved%20the%20application%20I%20work%20on%20everyday%20to%20Amazon%20Web%20Services%20and%20bravely%20adopted%20their%20Relational%20Database%20Service%20%28RDS%29%20and%20have%20had%20little%20trouble%20thus%20far%2C%20but%20the%20other%20day%20I%20noticed%20since%20we%20kicked%20into%20BST%2C%20timestamps%20in%20the%20data" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;h=Set%20MySQL%20connection%20variables%20with%20mysql-proxy" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F&amp;title=Set%20MySQL%20connection%20variables%20with%20mysql-proxy" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F06%2F01%2Fset-mysql-connection-variables-with-mysql-proxy%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2010/06/01/set-mysql-connection-variables-with-mysql-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wanted: New home for zfsnippets.com</title>
		<link>http://www.davedevelopment.co.uk/2010/04/26/wanted-new-home-for-zfsnippets-com/</link>
		<comments>http://www.davedevelopment.co.uk/2010/04/26/wanted-new-home-for-zfsnippets-com/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 10:58:22 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=471</guid>
		<description><![CDATA[Update 27/04/2010: I have received a number of enquiries via email and I&#8217;ll be going through them to try and find the best candidate, I&#8217;ll also make an effort to reply to all emails I&#8217;ve received. Thanks to all for your interest.
It&#8217;s been just over a year since I initially launched zfsnippets.com, it was a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update 27/04/2010:</strong> I have received a number of enquiries via email and I&#8217;ll be going through them to try and find the best candidate, I&#8217;ll also make an effort to reply to all emails I&#8217;ve received. Thanks to all for your interest.</p>
<p>It&#8217;s been just over a year since I <a href="http://www.davedevelopment.co.uk/2009/03/04/zfsnippetscom-zend-framework-code-snippets/">initially launched</a> <a href="http://zfsnippets.com">zfsnippets.com</a>, it was a good little project for me to get used to the Zend Framework, but since then I&#8217;ve totally neglected it. I&#8217;d normally leave a website going despite my lack of enthusiasm, but I no longer need the VPS it is hosted on so I&#8217;m looking for someone else to take the project on and move to their hosting solution.</p>
<p>My interests have moved quite rapidly in the last year and the project is sadly no longer of interest to me. ZFSnippets receives approximately 2,500 visits a month, so I think it&#8217;s worth keeping the project alive. </p>
<p><a href="http://www.davedevelopment.co.uk/wp-content/uploads/2010/04/screenshot2.png"><img src="http://www.davedevelopment.co.uk/wp-content/uploads/2010/04/screenshot2-300x154.png" alt="screenshot2" title="screenshot2" width="300" height="154" class="alignleft size-medium wp-image-472" /></a></p>
<p>If you&#8217;re interested in hosting the site and hopefully building on it and improving it, please email me, dave.marshall _at_ atstsolutions.co.uk.</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F04%2F26%2Fwanted-new-home-for-zfsnippets-com%2F&amp;title=Wanted%3A%20New%20home%20for%20zfsnippets.com&amp;bodytext=Update%2027%2F04%2F2010%3A%20I%20have%20received%20a%20number%20of%20enquiries%20via%20email%20and%20I%27ll%20be%20going%20through%20them%20to%20try%20and%20find%20the%20best%20candidate%2C%20I%27ll%20also%20make%20an%20effort%20to%20reply%20to%20all%20emails%20I%27ve%20received.%20Thanks%20to%20all%20for%20your%20interest.%0D%0A%0D%0AIt%27s%20been%20just%20ov" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F04%2F26%2Fwanted-new-home-for-zfsnippets-com%2F&amp;title=Wanted%3A%20New%20home%20for%20zfsnippets.com&amp;notes=Update%2027%2F04%2F2010%3A%20I%20have%20received%20a%20number%20of%20enquiries%20via%20email%20and%20I%27ll%20be%20going%20through%20them%20to%20try%20and%20find%20the%20best%20candidate%2C%20I%27ll%20also%20make%20an%20effort%20to%20reply%20to%20all%20emails%20I%27ve%20received.%20Thanks%20to%20all%20for%20your%20interest.%0D%0A%0D%0AIt%27s%20been%20just%20ov" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F04%2F26%2Fwanted-new-home-for-zfsnippets-com%2F&amp;h=Wanted%3A%20New%20home%20for%20zfsnippets.com" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F04%2F26%2Fwanted-new-home-for-zfsnippets-com%2F&amp;title=Wanted%3A%20New%20home%20for%20zfsnippets.com" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F04%2F26%2Fwanted-new-home-for-zfsnippets-com%2F&amp;title=Wanted%3A%20New%20home%20for%20zfsnippets.com" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F04%2F26%2Fwanted-new-home-for-zfsnippets-com%2F&amp;title=Wanted%3A%20New%20home%20for%20zfsnippets.com" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F04%2F26%2Fwanted-new-home-for-zfsnippets-com%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2010/04/26/wanted-new-home-for-zfsnippets-com/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Review: Zend Framework 1.8 Web Application Development</title>
		<link>http://www.davedevelopment.co.uk/2010/02/11/review-zend-framework-1-8-web-application-development/</link>
		<comments>http://www.davedevelopment.co.uk/2010/02/11/review-zend-framework-1-8-web-application-development/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 13:51:24 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[book review]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[zf]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=440</guid>
		<description><![CDATA[
Sometime last year, I, along with quite a few others, was asked to review one of
Packt Publishing&#8217;s new books, Zend Framework 1.8 Web Application Development, written by Keith Pope. They sent me a copy, which was very good of them and although it&#8217;s taken me ages to finish and get round to writing this review, [...]]]></description>
			<content:encoded><![CDATA[<p><a style="margin:0px 10px 10px 0px;float:left" href="http://www.packtpub.com/symfony-1-3-web-application-development?utm_source=shift-up.de&#038;utm_medium=bookrev&#038;utm_content=blog&#038;utm_campaign=mdb_001213"><img src="http://www.davedevelopment.co.uk/wp-content/uploads/2010/02/Zend-book-image.jpg" alt="Zend book image" title="Zend book image" width="100" height="123" class="alignleft size-full wp-image-441" /></a></p>
<p>Sometime last year, I, along with <a href="http://devzone.zend.com/article/11398">quite</a> <a href="http://blog.fedecarg.com/2009/12/11/review-zend-framework-1-8-web-application-development/">a</a> <a href="http://raphaelstolt.blogspot.com/2009/10/zend-framework-18-web-application.html">few</a> <a href="http://net.tutsplus.com/articles/reviews/book-review-zend-framework-1-8-web-application-development/">others</a>, was asked to review one of<br />
<a href="http://www.packtpub.com/">Packt Publishing</a>&#8217;s new books, <a href="http://www.packtpub.com/zend-framework-1-8-web-application-development?utm_source=davedevelopment.co.uk&#038;utm_medium=bookrev&#038;utm_content=blog&#038;utm_campaign=mdb_001551">Zend Framework 1.8 Web Application Development</a>, written by <a href="http://thepopeisdead.com/">Keith Pope</a>. They sent me a copy, which was very good of them and although it&#8217;s taken me ages to finish and get round to writing this review, that&#8217;s not a true reflection of how good the book was, I&#8217;m just a very busy/lazy person! So lazy, that I did in fact say I&#8217;d have it done in two weeks, which turned into 4 months.</p>
<blockquote cite="http://www.davedevelopment.co.uk/2009/10/15/zend-framework-1-8-web-application-development/"><p>Packt asked if I&#8217;d be interested in reviewing the book, so watch this space, I&#8217;ll be back in a couple of weeks with a review. </p>
</blockquote>
<p style="text-align:right;margin-top:-3px;padding-top:0px;font-size:90%"><a href="http://www.davedevelopment.co.uk/2009/10/15/zend-framework-1-8-web-application-development/">My Post dated 15/10/2009</a></p>
<h2>Introduction</h2>
<blockquote><p>Design, develop, and deploy feature-rich PHP web applications with this MVC framework</p>
</blockquote>
<p>That is the books strap line, and it does exactly what it says on the tin. The bulk of the book actually takes you through the design, development, testing and deployment of a <strong>real world example application</strong>, called the Storefront. The book claims that it is written for PHP web developers that are either using or looking to start using the <a href="http://framework.zend.com/">Zend Framework</a> and that a basic knowledge of Object Oriented design would be helpful. While you might be able to manage without any OOD experience, I&#8217;d say you definitely need some to get the most out of this book, as the second chapter digs right under the hood of the Frameworks <strong>MVC architecture</strong>. My personal experience was that I got to learn all the things I haven&#8217;t had time to learn, I&#8217;ve been using the Framework for a couple of years now, always appreciating, but not always <strong>understanding</strong> what it was doing for me. </p>
<h2>MVC Architecture</h2>
<p>The first chapter gives you a <strong>brief overview </strong>of creating an MVC application in the Zend Framework, experienced users of the Framework will probably want to gloss over this part, whereas people looking to start using the framework should take their time and take things in. The next chapter is when I really started to enjoy the book. Each <strong>component</strong> of the MVC architecture is presented as it&#8217;s own topic, with each component getting a breakdown of Design Patterns/theory, default settings/configuration, usage and finally customisation.
</p>
<p>The chapter is well put together and considering the amount of information portrayed, is <strong>not overwhelming</strong>.</p>
<h2>Storefront Application</h2>
<p>The rest of the book provides the information you need about the framework around a real world example application, called StoreFront, which is a basic e-commerce application. I should point out that I didn&#8217;t code the application as I went, if I&#8217;m reading I like to read, but where appropriate I have used the book as a reference when updating my existing Zend Framework applications.</p>
<p>The best thing about these chapters though, is some of the <strong>design theory</strong> you pick up on the way, that isn&#8217;t directly relevant to the Zend Framework, but can be applied to any framework out there. Best practices such as <a href="http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/">Fat Models</a>, <a href="http://martinfowler.com/bliki/AggregationAndComposition.html">Composition</a>, <a href="http://www.martinfowler.com/bliki/FluentInterface.html">Fluent interfaces</a> are all explained in detail, along with <strong>relevant and realistic examples</strong>. Further more, the applications MVC separation is excellent, taken in context (it might be a little overkill for the example application, but is there to show you the methods).</p>
<p>After taking you through the creation of the application, the book then takes you into optimisation and testing. The optimisation takes you though some general <strong>PHP optimisation techniques</strong>, but then ploughs into techniques like a transparent abstract cache that is applied to the models. Testing is carried out with the trusty <a href="http://www.phpunit.de/">PHPUnit</a>, along with the frameworks extension of the library <a href="http://framework.zend.com/manual/en/zend.test.html">Zend_Test</a> and the book goes on to integrate the test suites with <a href="http://ant.apache.org/">apache ant</a> (why not <a href="http://phing.info">phing</a>) and <a href="http://phpundercontrol.org/">phpundercontrol</a>.</p>
<h2>Conclusion</h2>
<p>In conclusion, I thought this book was <strong>an excellent read</strong> and I plan to follow it through again when I build my next ZF app (I have two good ideas in the pipeline).  <a href="http://www.packtpub.com/zend-framework-1-8-web-application-development?utm_source=davedevelopment.co.uk&#038;utm_medium=bookrev&#038;utm_content=blog&#038;utm_campaign=mdb_001551">Find out more <del datetime="2010-02-11T14:39:50+00:00">or</del> and buy it!</a>. Thanks to Packt for sending me a copy!</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F02%2F11%2Freview-zend-framework-1-8-web-application-development%2F&amp;title=Review%3A%20Zend%20Framework%201.8%20Web%20Application%20Development&amp;bodytext=%0D%0A%0D%0ASometime%20last%20year%2C%20I%2C%20along%20with%20quite%20a%20few%20others%2C%20was%20asked%20to%20review%20one%20of%20%0D%0APackt%20Publishing%27s%20new%20books%2C%20Zend%20Framework%201.8%20Web%20Application%20Development%2C%20written%20by%20Keith%20Pope.%20They%20sent%20me%20a%20copy%2C%20which%20was%20very%20good%20of%20them%20and%20although%20" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F02%2F11%2Freview-zend-framework-1-8-web-application-development%2F&amp;title=Review%3A%20Zend%20Framework%201.8%20Web%20Application%20Development&amp;notes=%0D%0A%0D%0ASometime%20last%20year%2C%20I%2C%20along%20with%20quite%20a%20few%20others%2C%20was%20asked%20to%20review%20one%20of%20%0D%0APackt%20Publishing%27s%20new%20books%2C%20Zend%20Framework%201.8%20Web%20Application%20Development%2C%20written%20by%20Keith%20Pope.%20They%20sent%20me%20a%20copy%2C%20which%20was%20very%20good%20of%20them%20and%20although%20" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F02%2F11%2Freview-zend-framework-1-8-web-application-development%2F&amp;h=Review%3A%20Zend%20Framework%201.8%20Web%20Application%20Development" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F02%2F11%2Freview-zend-framework-1-8-web-application-development%2F&amp;title=Review%3A%20Zend%20Framework%201.8%20Web%20Application%20Development" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F02%2F11%2Freview-zend-framework-1-8-web-application-development%2F&amp;title=Review%3A%20Zend%20Framework%201.8%20Web%20Application%20Development" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F02%2F11%2Freview-zend-framework-1-8-web-application-development%2F&amp;title=Review%3A%20Zend%20Framework%201.8%20Web%20Application%20Development" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2010%2F02%2F11%2Freview-zend-framework-1-8-web-application-development%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2010/02/11/review-zend-framework-1-8-web-application-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework Poster</title>
		<link>http://www.davedevelopment.co.uk/2009/08/21/zend-framework-poster/</link>
		<comments>http://www.davedevelopment.co.uk/2009/08/21/zend-framework-poster/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 11:18:59 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=429</guid>
		<description><![CDATA[After stumbling across an offer for a free Zend Framework Poster some time ago, I quickly dropped Mayflower an email. 
Some time passed, and now it&#8217;s here at work, placed next to our all important tea, coffee and biscuits station. 

It&#8217;s A0, covers nearly all of the major components and is well worth having! Top [...]]]></description>
			<content:encoded><![CDATA[<p>After stumbling across an offer for a <a href="http://blog.thinkphp.de/archives/399-Mayflower-loves-Zend-Framework.html">free Zend Framework Poster</a> some time ago, I quickly dropped <a href="http://mayflower.de">Mayflower</a> an email. </p>
<p>Some time passed, and now it&#8217;s here at work, placed next to our all important tea, coffee and biscuits station. </p>
<p><a href="http://www.davedevelopment.co.uk/wp-content/uploads/2009/08/Mayflower-poster.jpg"><img src="http://www.davedevelopment.co.uk/wp-content/uploads/2009/08/Mayflower-poster-300x199.jpg" alt="Mayflower poster" title="Mayflower poster" width="300" height="199" class="alignnone size-medium wp-image-430" /></a></p>
<p>It&#8217;s A0, covers nearly all of the major components and is well worth having! Top props to guys over there for pushing the <a href="http://framework.zend.com">Zend Framework</a> like this. Cheers!</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F08%2F21%2Fzend-framework-poster%2F&amp;title=Zend%20Framework%20Poster&amp;bodytext=After%20stumbling%20across%20an%20offer%20for%20a%20free%20Zend%20Framework%20Poster%20some%20time%20ago%2C%20I%20quickly%20dropped%20Mayflower%20an%20email.%20%0D%0A%0D%0ASome%20time%20passed%2C%20and%20now%20it%27s%20here%20at%20work%2C%20placed%20next%20to%20our%20all%20important%20tea%2C%20coffee%20and%20biscuits%20station.%20%0D%0A%0D%0A%0D%0A%0D%0AIt%27s%20A0%2C" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F08%2F21%2Fzend-framework-poster%2F&amp;title=Zend%20Framework%20Poster&amp;notes=After%20stumbling%20across%20an%20offer%20for%20a%20free%20Zend%20Framework%20Poster%20some%20time%20ago%2C%20I%20quickly%20dropped%20Mayflower%20an%20email.%20%0D%0A%0D%0ASome%20time%20passed%2C%20and%20now%20it%27s%20here%20at%20work%2C%20placed%20next%20to%20our%20all%20important%20tea%2C%20coffee%20and%20biscuits%20station.%20%0D%0A%0D%0A%0D%0A%0D%0AIt%27s%20A0%2C" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F08%2F21%2Fzend-framework-poster%2F&amp;h=Zend%20Framework%20Poster" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F08%2F21%2Fzend-framework-poster%2F&amp;title=Zend%20Framework%20Poster" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F08%2F21%2Fzend-framework-poster%2F&amp;title=Zend%20Framework%20Poster" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F08%2F21%2Fzend-framework-poster%2F&amp;title=Zend%20Framework%20Poster" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F08%2F21%2Fzend-framework-poster%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2009/08/21/zend-framework-poster/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mozilla&#8217;s Content Security Policy (CSP)</title>
		<link>http://www.davedevelopment.co.uk/2009/06/30/mozillas-content-security-policy-csp/</link>
		<comments>http://www.davedevelopment.co.uk/2009/06/30/mozillas-content-security-policy-csp/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 09:53:04 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[XHTML/CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=419</guid>
		<description><![CDATA[I saw this post via SlashDot and can&#8217;t help but think it&#8217;s a little overkill? 
Content Security Policy is intended to mitigate a large class of Web Application Vulnerabilities: Cross Site Scripting. Cross Site Request Forgery has also become a large scale problem in Web Application Security, though it is not a primary focus of [...]]]></description>
			<content:encoded><![CDATA[<p>I saw <a href="http://blog.mozilla.com/security/2009/06/19/shutting-down-xss-with-content-security-policy/">this post</a> via <a href="http://slashdot.org">SlashDot</a> and can&#8217;t help but think it&#8217;s a little overkill? </p>
<blockquote><p><a href="http://people.mozilla.org/~bsterne/content-security-policy/">Content Security Policy</a> is intended to mitigate a large class of Web Application Vulnerabilities: Cross Site Scripting. Cross Site Request Forgery has also become a large scale problem in Web Application Security, though it is not a primary focus of Content Security Policy.</p>
</blockquote>
<p>In an ideal world, this would be great, but getting all the browsers on board and implemented may take a while. I was thinking about this the other day and I don&#8217;t see why the browsers/w3c can&#8217;t standardise on some sort of tag or conditional comments that says don&#8217;t execute any script in here. This would be simple to use and surely simple to implement. Browsers already know what to do with <a href="http://www.w3schools.com/TAGS/tag_noscript.asp"><code>&lt;noscript&gt;</code></a></p>
<p>For Example: </p>
<pre class="php" name="code">
&lt;dontexecutescript&gt;
    &lt;?php echo $this-&gt;escape($userProvidedContent);?&gt;
&lt;/dontexecutescript&gt;
</pre>
<p>Or:</p>
<pre class="php" name="code">
&lt;!--[dontexecutescript] --&gt;
    &lt;?php echo $this-&gt;escape($userProvidedContent);?&gt;
&lt;!--[dontexecutescript]--&gt;
</pre>
<p>I&#8217;m no expert on <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">XSS</a>, but I&#8217;m pretty sure this would solve most of the issues encountered. </p>
<p><strong>Update:</strong></p>
<p>Okay, so one obvious problem might be that the <code>$userProvidedContent</code> contains a closing <code>&lt;/dontexecutescript&gt;</code> tag, but that&#8217;s just semantics. Unique identifiers for each block, ignoring tags that don&#8217;t match up, these browser developers are clever, they could come up with something. </p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F06%2F30%2Fmozillas-content-security-policy-csp%2F&amp;title=Mozilla%27s%20Content%20Security%20Policy%20%28CSP%29&amp;bodytext=I%20saw%20this%20post%20via%20SlashDot%20and%20can%27t%20help%20but%20think%20it%27s%20a%20little%20overkill%3F%20%0D%0A%0D%0AContent%20Security%20Policy%20is%20intended%20to%20mitigate%20a%20large%20class%20of%20Web%20Application%20Vulnerabilities%3A%20Cross%20Site%20Scripting.%20Cross%20Site%20Request%20Forgery%20has%20also%20become%20a%20lar" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F06%2F30%2Fmozillas-content-security-policy-csp%2F&amp;title=Mozilla%27s%20Content%20Security%20Policy%20%28CSP%29&amp;notes=I%20saw%20this%20post%20via%20SlashDot%20and%20can%27t%20help%20but%20think%20it%27s%20a%20little%20overkill%3F%20%0D%0A%0D%0AContent%20Security%20Policy%20is%20intended%20to%20mitigate%20a%20large%20class%20of%20Web%20Application%20Vulnerabilities%3A%20Cross%20Site%20Scripting.%20Cross%20Site%20Request%20Forgery%20has%20also%20become%20a%20lar" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F06%2F30%2Fmozillas-content-security-policy-csp%2F&amp;h=Mozilla%27s%20Content%20Security%20Policy%20%28CSP%29" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F06%2F30%2Fmozillas-content-security-policy-csp%2F&amp;title=Mozilla%27s%20Content%20Security%20Policy%20%28CSP%29" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F06%2F30%2Fmozillas-content-security-policy-csp%2F&amp;title=Mozilla%27s%20Content%20Security%20Policy%20%28CSP%29" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F06%2F30%2Fmozillas-content-security-policy-csp%2F&amp;title=Mozilla%27s%20Content%20Security%20Policy%20%28CSP%29" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F06%2F30%2Fmozillas-content-security-policy-csp%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2009/06/30/mozillas-content-security-policy-csp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rev=Canonical and all that Jazz</title>
		<link>http://www.davedevelopment.co.uk/2009/04/15/revcanonical-and-all-that-jazz/</link>
		<comments>http://www.davedevelopment.co.uk/2009/04/15/revcanonical-and-all-that-jazz/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 11:58:29 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[revcanonical]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=389</guid>
		<description><![CDATA[If anybody missed it, the last few days has seen plenty of buzz around a new proposal on how to solve the problem with URL shorteners. I kind of got lost in all the different methods and proposals people are discussing, suggesting or implementing, but I went ahead and added some simple logic to lnkd.in, [...]]]></description>
			<content:encoded><![CDATA[<p>If anybody missed it, the last few days has seen <a href="http://search.twitter.com/search?q=%23revcanonical">plenty of buzz</a> around a <a href="http://revcanonical.appspot.com/">new proposal</a> on how to solve the <a href="http://joshua.schachter.org/2009/04/on-url-shorteners.html">problem with URL shorteners</a>. I kind of got lost in all the different methods and proposals people are <a href="http://benramsey.com/archives/a-revcanonical-rebuttal/">discussing</a>, <a href="http://shiflett.org/blog/2009/apr/a-rev-canonical-http-header">suggesting</a> or <a href="http://simonwillison.net/2009/Apr/11/revcanonical/">implementing</a>, but I went ahead and added some simple logic to <a href="http://lnkd.in">lnkd.in</a>, to do a HTTP HEAD request to the given URL, looking for headers in a couple of the formats suggested. I figured that was going to get out of date pretty quickly, so I modified it to use the <a href="http://revcanonical.appspot.com/api">RevCanonical API</a>, seems to work pretty well, returning a rev=canonical url wherever possible.</p>
<p>I also contributed a basic bit of code to <a href="http://akrabat.com">Rob Allen&#8217;s</a> <a href="http://akrabat.com/shorter-links">Shorter Links</a> plugin for wordpress, allowing users to specifying a base url, davedevelopment.co.uk isn&#8217;t all that good for short URLs. Just need to upgrade the plugin and decide on a short domain for my blog now.</p>
<p><strong>Update</strong>: registerd <a href="http://daved.in">daved.in</a>, works a treat</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F04%2F15%2Frevcanonical-and-all-that-jazz%2F&amp;title=Rev%3DCanonical%20and%20all%20that%20Jazz&amp;bodytext=If%20anybody%20missed%20it%2C%20the%20last%20few%20days%20has%20seen%20plenty%20of%20buzz%20around%20a%20new%20proposal%20on%20how%20to%20solve%20the%20problem%20with%20URL%20shorteners.%20I%20kind%20of%20got%20lost%20in%20all%20the%20different%20methods%20and%20proposals%20people%20are%20discussing%2C%20suggesting%20or%20implementing%2C%20bu" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F04%2F15%2Frevcanonical-and-all-that-jazz%2F&amp;title=Rev%3DCanonical%20and%20all%20that%20Jazz&amp;notes=If%20anybody%20missed%20it%2C%20the%20last%20few%20days%20has%20seen%20plenty%20of%20buzz%20around%20a%20new%20proposal%20on%20how%20to%20solve%20the%20problem%20with%20URL%20shorteners.%20I%20kind%20of%20got%20lost%20in%20all%20the%20different%20methods%20and%20proposals%20people%20are%20discussing%2C%20suggesting%20or%20implementing%2C%20bu" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F04%2F15%2Frevcanonical-and-all-that-jazz%2F&amp;h=Rev%3DCanonical%20and%20all%20that%20Jazz" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F04%2F15%2Frevcanonical-and-all-that-jazz%2F&amp;title=Rev%3DCanonical%20and%20all%20that%20Jazz" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F04%2F15%2Frevcanonical-and-all-that-jazz%2F&amp;title=Rev%3DCanonical%20and%20all%20that%20Jazz" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F04%2F15%2Frevcanonical-and-all-that-jazz%2F&amp;title=Rev%3DCanonical%20and%20all%20that%20Jazz" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2009%2F04%2F15%2Frevcanonical-and-all-that-jazz%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2009/04/15/revcanonical-and-all-that-jazz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework and the Twitter API</title>
		<link>http://www.davedevelopment.co.uk/2008/10/13/zend-framework-and-the-twitter-api/</link>
		<comments>http://www.davedevelopment.co.uk/2008/10/13/zend-framework-and-the-twitter-api/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 14:16:58 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=200</guid>
		<description><![CDATA[I wanted my new job website to post a tweet to twitter every time we approved a posting. 
Zend_Service_Twitter looks like it will be fairly comprehensive, but it&#8217;s not in the core yet and is probably a little overkill for my simple use case. 
I then had a look at Zend_Rest_Client, which seemed to confuse [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted my new <a href="http://www.phppositions.co.uk" title="UK PHP Jobs">job website</a> to post a tweet to <a href="http://twitter.com/">twitter</a> every time we approved a posting. </p>
<p><a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Service_Twitter">Zend_Service_Twitter</a> looks like it will be fairly comprehensive, but it&#8217;s not in the core yet and is probably a little overkill for my simple use case. </p>
<p>I then had a look at <a href="http://framework.zend.com/manual/en/zend.rest.client.html">Zend_Rest_Client</a>, which seemed to confuse me. I couldn&#8217;t actually get it to add the parameters I wanted to the call, I guess it&#8217;s better for interacting with <a href="http://framework.zend.com/manual/en/zend.rest.server.html">Zend_Rest_Server</a> or fully <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">restful</a> APIs.
</p>
<p>To be fair, the manual actually states:</p>
<blockquote><p>
[Warning] 	Strictness of Zend_Rest_Client</p>
<p>Any REST service that is strict about the arguments it receives will likely fail using Zend_Rest_Client, because of the behavior described above. This is not a common practice and should not cause problems. </p></blockquote>
<p>So here&#8217;s some simple code using <a href="http://framework.zend.com/manual/en/zend.http.html">Zend_Http_Client</a>.</p>
<pre name="code" class="php">
< ?php
require_once 'Zend/Http/Client.php';

$http = new Zend_Http_Client('http://twitter.com/statuses/update.xml', array(
    'maxredirects' => 0,
    'timeout'      => 10,
));

$http->setAuth(
    'twitter_username',
    'twitter_password',
     Zend_Http_Client::AUTH_BASIC
);

$http->setMethod(Zend_Http_Client::POST);
$http->setParameterPost('status', 'Your status message');
$http->request();

?>
</pre>
<p><strong><em>Advertisement</em></strong>:  <a href="http://www.phppositions.co.uk">PHPPositions UK</a><em> </em>- Genuine PHP jobs, at Genuine companies</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F10%2F13%2Fzend-framework-and-the-twitter-api%2F&amp;title=Zend%20Framework%20and%20the%20Twitter%20API&amp;bodytext=I%20wanted%20my%20new%20job%20website%20to%20post%20a%20tweet%20to%20twitter%20every%20time%20we%20approved%20a%20posting.%20%0D%0A%0D%0AZend_Service_Twitter%20looks%20like%20it%20will%20be%20fairly%20comprehensive%2C%20but%20it%27s%20not%20in%20the%20core%20yet%20and%20is%20probably%20a%20little%20overkill%20for%20my%20simple%20use%20case.%20%0D%0A%0D%0AI" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F10%2F13%2Fzend-framework-and-the-twitter-api%2F&amp;title=Zend%20Framework%20and%20the%20Twitter%20API&amp;notes=I%20wanted%20my%20new%20job%20website%20to%20post%20a%20tweet%20to%20twitter%20every%20time%20we%20approved%20a%20posting.%20%0D%0A%0D%0AZend_Service_Twitter%20looks%20like%20it%20will%20be%20fairly%20comprehensive%2C%20but%20it%27s%20not%20in%20the%20core%20yet%20and%20is%20probably%20a%20little%20overkill%20for%20my%20simple%20use%20case.%20%0D%0A%0D%0AI" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F10%2F13%2Fzend-framework-and-the-twitter-api%2F&amp;h=Zend%20Framework%20and%20the%20Twitter%20API" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F10%2F13%2Fzend-framework-and-the-twitter-api%2F&amp;title=Zend%20Framework%20and%20the%20Twitter%20API" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F10%2F13%2Fzend-framework-and-the-twitter-api%2F&amp;title=Zend%20Framework%20and%20the%20Twitter%20API" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F10%2F13%2Fzend-framework-and-the-twitter-api%2F&amp;title=Zend%20Framework%20and%20the%20Twitter%20API" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F10%2F13%2Fzend-framework-and-the-twitter-api%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2008/10/13/zend-framework-and-the-twitter-api/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>A step in the right direction</title>
		<link>http://www.davedevelopment.co.uk/2008/07/15/a-step-in-the-right-direction/</link>
		<comments>http://www.davedevelopment.co.uk/2008/07/15/a-step-in-the-right-direction/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 21:42:17 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[licensing]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=69</guid>
		<description><![CDATA[At my current workplace, on a particular project we have not been allowed to use third party libraries, due to fears of licensing issues if and when we come to sell the product. The project is predominantly for the business, but it would be nice if we could convert the product into something we could [...]]]></description>
			<content:encoded><![CDATA[<p>At my current workplace, on a particular project we have not been allowed to use third party libraries, due to fears of licensing issues if and when we come to sell the product. The project is predominantly for the business, but it would be nice if we could convert the product into something we could market.</p>
<p>Despite multiple discussions and suggesting to management that open source software licensed under an <a href="http://en.wikipedia.org/wiki/MIT_License">MIT</a> or <a href="http://en.wikipedia.org/wiki/BSD_license">BSD</a> license would not have any implications, they would not have it. This has meant writing pretty much everything we need from scratch.</p>
<p>Recently, the managing director must have noticed the improved the user experience the little bit of JavaScript we use brings to the product. In previous conversations, I&#8217;ve mentioned to the MD that JavaScript is an area that the development team has little experience with, and this seems to have nudged him into letting us use a third party library or tool kit within the product. I spent a bit of time reviewing some of the frameworks and tool kits out there and basically boiled down to going with <a href="http://dojotoolkit.org/">Dojo</a>. Most of the frameworks reviewed provide similar features, Dojo came up on top because of the BSD license, recent announcement of a <a href="http://dojotoolkit.org/2008/05/21/announcing-zend-framework-integration-dojo-1-x-0">partnership</a> with the <a href="http://framework.zend.com/">Zend Framework</a> and the added bonus of contributors having to sign a <a href="http://dojotoolkit.org/cla">CLA</a>. Looking forward to getting stuck into it and making our application a little easier on the eye.</p>
<p>The next task is to go about documenting the best way to include and use the tool kit in our application, will write about it if I get chance.</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F07%2F15%2Fa-step-in-the-right-direction%2F&amp;title=A%20step%20in%20the%20right%20direction&amp;bodytext=At%20my%20current%20workplace%2C%20on%20a%20particular%20project%20we%20have%20not%20been%20allowed%20to%20use%20third%20party%20libraries%2C%20due%20to%20fears%20of%20licensing%20issues%20if%20and%20when%20we%20come%20to%20sell%20the%20product.%20The%20project%20is%20predominantly%20for%20the%20business%2C%20but%20it%20would%20be%20nice%20if%20w" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F07%2F15%2Fa-step-in-the-right-direction%2F&amp;title=A%20step%20in%20the%20right%20direction&amp;notes=At%20my%20current%20workplace%2C%20on%20a%20particular%20project%20we%20have%20not%20been%20allowed%20to%20use%20third%20party%20libraries%2C%20due%20to%20fears%20of%20licensing%20issues%20if%20and%20when%20we%20come%20to%20sell%20the%20product.%20The%20project%20is%20predominantly%20for%20the%20business%2C%20but%20it%20would%20be%20nice%20if%20w" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F07%2F15%2Fa-step-in-the-right-direction%2F&amp;h=A%20step%20in%20the%20right%20direction" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F07%2F15%2Fa-step-in-the-right-direction%2F&amp;title=A%20step%20in%20the%20right%20direction" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F07%2F15%2Fa-step-in-the-right-direction%2F&amp;title=A%20step%20in%20the%20right%20direction" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F07%2F15%2Fa-step-in-the-right-direction%2F&amp;title=A%20step%20in%20the%20right%20direction" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F07%2F15%2Fa-step-in-the-right-direction%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2008/07/15/a-step-in-the-right-direction/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fat Models and the Data Access Layer</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/</link>
		<comments>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 20:57:12 +0000</pubDate>
		<dc:creator>davedevelopment</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Patterns]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66</guid>
		<description><![CDATA[There&#8217;s been some discussion recently on why active record:

Sucks
Sucks &#8211; but not like that;
Doesn&#8217;t suck

I like the active record pattern, so I don&#8217;t think it sucks, but I do think it&#8217;s used a little out of context sometimes. 
If you&#8217;re building a small lightweight app, then I think using your Data access layer as the [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been some discussion recently on why active record:</p>
<ol>
<li><a href="http://kore-nordmann.de/blog/why_active_record_sucks.html">Sucks</a></li>
<li><a href="http://blog.mikeseth.com/index.php?/archives/4-ActiveRecord-sucks,-but-Kore-Nordmann-is-wrong.html">Sucks &#8211; but not like that</a>;</li>
<li><a href="http://karwin.blogspot.com/2008/05/activerecord-does-not-suck.html">Doesn&#8217;t suck</a></li>
</ol>
<p>I like the active record pattern, so I don&#8217;t think it sucks, but I do think it&#8217;s used a little out of context sometimes. </p>
<p>If you&#8217;re building a small lightweight app, then I think using your <a href="http://en.wikipedia.org/wiki/Data_access_layer">Data access layer</a> as the M in <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> is a logical thing to do. It&#8217;s quick, it&#8217;s easy and you can extend either your <a href="http://wiki.rubyonrails.org/rails/pages/ActiveRecord">active record</a> in <a href="http://www.rubyonrails.org/">Rails</a>, or extend your <a href="http://framework.zend.com/manual/en/zend.db.table.html">Table DataGateway</a> in the <a href="http://framework.zend.com">Zend Framework</a> and you wont go far wrong.</p>
<p>As soon as your app gets a little more complex, you might want to start creating custom<br />
models that contain more business logic than simply pulling and pushing to the database. If your application is complex enough, chances are your model will need to interact with more than one database table, if not database, so at this point, like Bill Karwin pointed out, your model should be <em>using</em> the DAL, not <em>being</em> the DAL. Loosening the coupling between model and DAL, should also help with automated testing the business logic, in that mock objects could replace the DAL. </p>
<p>The only problem is, I don&#8217;t know the best way to do it.</p>
<p>I&#8217;m currently learning the ways of the Zend Framework and would be interested to see how people think the best way to implement this kind of complex model. I&#8217;m currently leaning toward something like this. I&#8217;ve included a <a href="http://framework.zend.com/manual/en/zend.form.html">Zend_Form</a> object, to show how the <tt>Persons</tt> model encapsulates more logic than just pushing to and from the database. I think the biggest benefit of Zend_Form is validating input, which I consider domain logic, so should be part of the model. But I&#8217;m not sure the best way to make things easily testable, without pushing into the realms of fancy <a href="http://martinfowler.com/articles/injection.html">Dependency Injection</a> and what not, which I&#8217;m not all that familiar with.</p>
<p>File: application/models/Persons.php</p>
<pre name="code" class="php">
&lt;?php

class Persons
{
    public function findByEmail($email)
    {
        $table  = self::getTable();
        $select = $table->select()
                        ->where('email = ?', $email);
        return $table->fetchAll($select);
    }

    public static function getTable()
    {
        // add some dependency injection?
        return new Persons_Table();
    }   

    public static function getForm()
    {
        // add some dependency injection?
        return new Persons_Form();
    }

    // ...
}
</pre>
<p>File: application/models/Persons/Table.php</p>
<pre name="code" class="php">
&lt;?php

class Persons_Table extends Zend_Db_Table
{
    protected $_name = 'persons';

    // ...
}
</pre>
<p>File: application/models/Persons/Form.php</p>
<pre name="code" class="php">
&lt;?php

class Persons_Form extends Zend_Form
{
    // ...
}
</pre>
<p>At first it may seem that the <tt>Persons</tt> model just ends up acting as a <a href="http://en.wikipedia.org/wiki/Proxy_pattern">proxy</a> to the <tt>Persons_Form</tt> and <tt>Persons_Table</tt>, but once you start writing methods that use both together, you&#8217;ll start seeing fatter models and thin controllers, which is all good.</p>
<p>This really is a request for comments really, as I&#8217;m personally not sure about the best way to go about this. Would be interesting if any of the people using the MVC part of the Zend Framework in the real world go about this?</p>




	<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F06%2F17%2Ffat-models-and-the-data-access-layer%2F&amp;title=Fat%20Models%20and%20the%20Data%20Access%20Layer&amp;bodytext=There%27s%20been%20some%20discussion%20recently%20on%20why%20active%20record%3A%0D%0A%0D%0A%20%20%20%20Sucks%0D%0ASucks%20-%20but%20not%20like%20that%3B%0D%0A%20%20%20%20Doesn%27t%20suck%0D%0A%0D%0A%0D%0AI%20like%20the%20active%20record%20pattern%2C%20so%20I%20don%27t%20think%20it%20sucks%2C%20but%20I%20do%20think%20it%27s%20used%20a%20little%20out%20of%20context%20sometimes.%20%0D%0A%0D%0AI" title="Digg"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://delicious.com/post?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F06%2F17%2Ffat-models-and-the-data-access-layer%2F&amp;title=Fat%20Models%20and%20the%20Data%20Access%20Layer&amp;notes=There%27s%20been%20some%20discussion%20recently%20on%20why%20active%20record%3A%0D%0A%0D%0A%20%20%20%20Sucks%0D%0ASucks%20-%20but%20not%20like%20that%3B%0D%0A%20%20%20%20Doesn%27t%20suck%0D%0A%0D%0A%0D%0AI%20like%20the%20active%20record%20pattern%2C%20so%20I%20don%27t%20think%20it%20sucks%2C%20but%20I%20do%20think%20it%27s%20used%20a%20little%20out%20of%20context%20sometimes.%20%0D%0A%0D%0AI" title="del.icio.us"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F06%2F17%2Ffat-models-and-the-data-access-layer%2F&amp;h=Fat%20Models%20and%20the%20Data%20Access%20Layer" title="NewsVine"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F06%2F17%2Ffat-models-and-the-data-access-layer%2F&amp;title=Fat%20Models%20and%20the%20Data%20Access%20Layer" title="Reddit"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow" href="" title="Furl"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/" title="Furl" alt="Furl" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F06%2F17%2Ffat-models-and-the-data-access-layer%2F&amp;title=Fat%20Models%20and%20the%20Data%20Access%20Layer" title="DZone"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F06%2F17%2Ffat-models-and-the-data-access-layer%2F&amp;title=Fat%20Models%20and%20the%20Data%20Access%20Layer" title="StumbleUpon"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.davedevelopment.co.uk%2F2008%2F06%2F17%2Ffat-models-and-the-data-access-layer%2F" title="Technorati"><img src="http://www.davedevelopment.co.uk/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
