<?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/"
		>
<channel>
	<title>Comments on: Fat Models and the Data Access Layer</title>
	<atom:link href="http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/</link>
	<description>Dave Marshall</description>
	<lastBuildDate>Sun, 24 Jan 2010 23:46:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Redmine Issue Tracker/Project Management &#124; DaveDevelopment</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-79681</link>
		<dc:creator>Redmine Issue Tracker/Project Management &#124; DaveDevelopment</dc:creator>
		<pubDate>Mon, 20 Apr 2009 15:30:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-79681</guid>
		<description>[...] No API! It would be really nice to have an API and there&#8217;s one in the works, but it&#8217;s sounds like it&#8217;s a bit of a ballache changing fat controllers into fat models. [...]</description>
		<content:encoded><![CDATA[<p>[...] No API! It would be really nice to have an API and there&#8217;s one in the works, but it&#8217;s sounds like it&#8217;s a bit of a ballache changing fat controllers into fat models. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-04-09 &#171; sySolution</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-78908</link>
		<dc:creator>links for 2009-04-09 &#171; sySolution</dc:creator>
		<pubDate>Thu, 09 Apr 2009 15:01:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-78908</guid>
		<description>[...] Fat Models and the Data Access Layer &#124; DaveDevelopment (tags: php zend zendframework) [...]</description>
		<content:encoded><![CDATA[<p>[...] Fat Models and the Data Access Layer | DaveDevelopment (tags: php zend zendframework) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: daveyboy</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-76249</link>
		<dc:creator>daveyboy</dc:creator>
		<pubDate>Sat, 07 Mar 2009 17:34:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-76249</guid>
		<description>@matt Check out Matthew Weier O&#039;Phinney&#039;s post on &lt;a href=&quot;http://weierophinney.net/matthew/archives/202-Model-Infrastructure.html&quot; rel=&quot;nofollow&quot;&gt;Model Infrastructure&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>@matt Check out Matthew Weier O&#8217;Phinney&#8217;s post on <a href="http://weierophinney.net/matthew/archives/202-Model-Infrastructure.html" rel="nofollow">Model Infrastructure</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-76237</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sat, 07 Mar 2009 12:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-76237</guid>
		<description>A good post and something I&#039;ve been questioning myself lately. I&#039;ve been pointed in the direction of ORM but there&#039;s no good pre-existing Zend solutions available.

One thing that springs to mind here is that by extending Zend_Form you are substituting Zend_DB&#039;s fluff with Zend_Forms in your &#039;object&#039; class. So really the coupling moves from Zend_DB to Zend_Form.

Definitely an interesting substitution though, food for thought! :)

Has anyone found/come up with any other good solutions in the interim?</description>
		<content:encoded><![CDATA[<p>A good post and something I&#8217;ve been questioning myself lately. I&#8217;ve been pointed in the direction of ORM but there&#8217;s no good pre-existing Zend solutions available.</p>
<p>One thing that springs to mind here is that by extending Zend_Form you are substituting Zend_DB&#8217;s fluff with Zend_Forms in your &#8216;object&#8217; class. So really the coupling moves from Zend_DB to Zend_Form.</p>
<p>Definitely an interesting substitution though, food for thought! :)</p>
<p>Has anyone found/come up with any other good solutions in the interim?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; Models im Zend Framework (I) - comfuzius - Fachchinesisch f&#252;r Entwickler</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-72512</link>
		<dc:creator>&#187; Models im Zend Framework (I) - comfuzius - Fachchinesisch f&#252;r Entwickler</dc:creator>
		<pubDate>Sun, 11 Jan 2009 13:24:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-72512</guid>
		<description>[...] Dave Marshall: Fat Models and the Data Access Layer [...]</description>
		<content:encoded><![CDATA[<p>[...] Dave Marshall: Fat Models and the Data Access Layer [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Lo</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-56254</link>
		<dc:creator>Nick Lo</dc:creator>
		<pubDate>Mon, 23 Jun 2008 12:43:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-56254</guid>
		<description>Hi Dave,

Aside from what seems to be questioning a gut feeling, you don&#039;t really specify any particular issue with what you&#039;re doing so maybe what you&#039;re after is some additional justification...

First you could mention the added flavour that a row class would bring to this mix:

// in your table class
protected $_name = &#039;persons&#039;; 
protected $_rowClass = &#039;Persons_Row&#039;;

class Content_Row extends Zend_Db_Table_Row_Abstract implements Some_Cool_Class
{
    protected function _insert()
    {
    	if(is_null($this-&gt;date_created)) {
    		$this-&gt;date_created = date(&#039;Y-m-d H:i:s&#039;);
        }
    }
}

Then that your persons class is now freer to subclass something like say an observer pattern class:

class Persons extends Something implements Something_Else ...

Finally (since it&#039;s too late for anything else to spring to mind rather than this being a grand reason) I&#039;ll wave my hand and say I&#039;ve been taking this approach. I&#039;ve not however had the form tied so tightly though I do like the idea.

Fat Model, skinny controller in a flexible more easily testable package; looks good.</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>Aside from what seems to be questioning a gut feeling, you don&#8217;t really specify any particular issue with what you&#8217;re doing so maybe what you&#8217;re after is some additional justification&#8230;</p>
<p>First you could mention the added flavour that a row class would bring to this mix:</p>
<p>// in your table class<br />
protected $_name = &#8216;persons&#8217;;<br />
protected $_rowClass = &#8216;Persons_Row&#8217;;</p>
<p>class Content_Row extends Zend_Db_Table_Row_Abstract implements Some_Cool_Class<br />
{<br />
    protected function _insert()<br />
    {<br />
    	if(is_null($this-&gt;date_created)) {<br />
    		$this-&gt;date_created = date(&#8217;Y-m-d H:i:s&#8217;);<br />
        }<br />
    }<br />
}</p>
<p>Then that your persons class is now freer to subclass something like say an observer pattern class:</p>
<p>class Persons extends Something implements Something_Else &#8230;</p>
<p>Finally (since it&#8217;s too late for anything else to spring to mind rather than this being a grand reason) I&#8217;ll wave my hand and say I&#8217;ve been taking this approach. I&#8217;ve not however had the form tied so tightly though I do like the idea.</p>
<p>Fat Model, skinny controller in a flexible more easily testable package; looks good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-56248</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 23 Jun 2008 11:34:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-56248</guid>
		<description>If you guys come to implement some more on this &quot;new/divided&quot; Model, please publish it here. I&#039;m very curious about this ideas.

I think it&#039;s hard to foreseen if a class will be reusable or not, I&#039;m mean, will be &quot;need&quot; in another process or not, so I always try to loose the coupling the most I can.

So to me, having this new layer is very cheap and worths the price, always. It&#039;s cleaner and gives back to Model it&#039;s actual role, that is take care of the logic, the &quot;information&quot;, and let the TableGateway take care of the &quot;data&quot;.</description>
		<content:encoded><![CDATA[<p>If you guys come to implement some more on this &#8220;new/divided&#8221; Model, please publish it here. I&#8217;m very curious about this ideas.</p>
<p>I think it&#8217;s hard to foreseen if a class will be reusable or not, I&#8217;m mean, will be &#8220;need&#8221; in another process or not, so I always try to loose the coupling the most I can.</p>
<p>So to me, having this new layer is very cheap and worths the price, always. It&#8217;s cleaner and gives back to Model it&#8217;s actual role, that is take care of the logic, the &#8220;information&#8221;, and let the TableGateway take care of the &#8220;data&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. Pluijmers</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-56228</link>
		<dc:creator>J. Pluijmers</dc:creator>
		<pubDate>Mon, 23 Jun 2008 08:31:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-56228</guid>
		<description>There isn&#039;t really common practise for this. In cases like this I ask myself:

1. How reusable is this package iam creating? Is abstracting it really worth the effort and if iam going to absctract how abstract would it need to be to be reusable?

2. Enviorment, in the context of your example its realy the duty of the controller to couple both models together. Hence all the methods described in the linked article Dependency Injection can be applied. But wich solution all depends on rule 1.</description>
		<content:encoded><![CDATA[<p>There isn&#8217;t really common practise for this. In cases like this I ask myself:</p>
<p>1. How reusable is this package iam creating? Is abstracting it really worth the effort and if iam going to absctract how abstract would it need to be to be reusable?</p>
<p>2. Enviorment, in the context of your example its realy the duty of the controller to couple both models together. Hence all the methods described in the linked article Dependency Injection can be applied. But wich solution all depends on rule 1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: daveyboy</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-55908</link>
		<dc:creator>daveyboy</dc:creator>
		<pubDate>Sat, 21 Jun 2008 09:49:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-55908</guid>
		<description>Thanks demon, an abstract Model class could definitely provide the basic getForm and getTable methods, would save implementing them repeatedly, seeing as we&#039;d probably want to do Organisation::getTable() from the Person Model for example.

I had a quick look at &lt;a href=&quot;http://www.google.com/url?sa=t&amp;ct=res&amp;cd=2&amp;url=http%3A%2F%2Fframework.zend.com%2Fwiki%2Fdisplay%2FZFPROP%2FZend_Di%2B-%2BFederico%2BCargnelutti&amp;ei=OM5cSLH2GZyUQpnE7Z4E&amp;usg=AFQjCNHGQMeufBzx4BTN9A583SOiWAv4fg&amp;sig2=4S7YSa_pxrLY_ZtwY4K_wQ&quot; rel=&quot;nofollow&quot;&gt;Zend_Di&lt;/a&gt;, which looks like a nice simple solution to the Dependency Injection.

I wouldn&#039;t hold your breath for more comments, this blogs not popular enough ;)</description>
		<content:encoded><![CDATA[<p>Thanks demon, an abstract Model class could definitely provide the basic getForm and getTable methods, would save implementing them repeatedly, seeing as we&#8217;d probably want to do Organisation::getTable() from the Person Model for example.</p>
<p>I had a quick look at <a href="http://www.google.com/url?sa=t&#038;ct=res&#038;cd=2&#038;url=http%3A%2F%2Fframework.zend.com%2Fwiki%2Fdisplay%2FZFPROP%2FZend_Di%2B-%2BFederico%2BCargnelutti&#038;ei=OM5cSLH2GZyUQpnE7Z4E&#038;usg=AFQjCNHGQMeufBzx4BTN9A583SOiWAv4fg&#038;sig2=4S7YSa_pxrLY_ZtwY4K_wQ" rel="nofollow">Zend_Di</a>, which looks like a nice simple solution to the Dependency Injection.</p>
<p>I wouldn&#8217;t hold your breath for more comments, this blogs not popular enough ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: demonburrito</title>
		<link>http://www.davedevelopment.co.uk/2008/06/17/fat-models-and-the-data-access-layer/comment-page-1/#comment-55882</link>
		<dc:creator>demonburrito</dc:creator>
		<pubDate>Sat, 21 Jun 2008 06:34:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.davedevelopment.co.uk/?p=66#comment-55882</guid>
		<description>I think you&#039;re on the right track with this approach. I&#039;ve been trying to make models fatter with ZF recently, but it had not occurred to me to consider Zend_Form to be part of the model. I like it a lot.

It seems there are a whole bunch of alternative implementations available to you, though. Persons could extend an abstract class with default definitions of getTable and getForm, instead of being static methods of Persons. That abstract class could use the same kind of path magic that Zend_Loader uses, or you could just stick to your filename convention; using the __CLASS__ magic constant for the directory name.

That&#039;s just off the top of my head... I don&#039;t know if this fits smoothly in to your TDD routine. My head always hurts after reading Fowler (always worth it, though).

Can&#039;t wait to see more comments on this. Good post.</description>
		<content:encoded><![CDATA[<p>I think you&#8217;re on the right track with this approach. I&#8217;ve been trying to make models fatter with ZF recently, but it had not occurred to me to consider Zend_Form to be part of the model. I like it a lot.</p>
<p>It seems there are a whole bunch of alternative implementations available to you, though. Persons could extend an abstract class with default definitions of getTable and getForm, instead of being static methods of Persons. That abstract class could use the same kind of path magic that Zend_Loader uses, or you could just stick to your filename convention; using the __CLASS__ magic constant for the directory name.</p>
<p>That&#8217;s just off the top of my head&#8230; I don&#8217;t know if this fits smoothly in to your TDD routine. My head always hurts after reading Fowler (always worth it, though).</p>
<p>Can&#8217;t wait to see more comments on this. Good post.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
