<?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: Zend Framework &#8211; An Example Model</title>
	<atom:link href="http://www.littleblackhat.com/blog/2008/05/zend-framework-an-example-model/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.littleblackhat.com/blog/2008/05/zend-framework-an-example-model/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zend-framework-an-example-model</link>
	<description>Little Black Hat is about the goings on of an average Internet Developer</description>
	<lastBuildDate>Fri, 22 Jun 2012 14:41:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Kevin Hallmark</title>
		<link>http://www.littleblackhat.com/blog/2008/05/zend-framework-an-example-model/comment-page-1/#comment-225</link>
		<dc:creator>Kevin Hallmark</dc:creator>
		<pubDate>Sat, 16 Apr 2011 05:14:37 +0000</pubDate>
		<guid isPermaLink="false">http://littleblackhat.com/blog/?p=9#comment-225</guid>
		<description><![CDATA[I need to upload my new BaseModel and write an article about it. For now though, I&#039;ll address your point.

By your logic, the &quot;clean&quot; OO approach should descend from neither the Row or the Table. The DAL should be completely independent. However, I ran into some problems with this approach.

The reason I chose to descend it from Zend_Db_Table_Row because I generally want to interact with individual data objects, or collections there-in. I tried going through the clean OO approach originally, and it resulted in a lot of pass through code. It also broke record collections. In order to support collections coming from Zend, I ended up creating a lot of extra objects. Memory overhead was through the roof and the population algorithms got very expensive.

Another factor is abstraction for the fetching of data objects. I don&#039;t want to assume that my application will be database based in the future. If I switch to something else, like SOAP or REST based model population, then a Table is no longer relevant. The idea behind the static methods for fetching ONLY is that it abstracts out the retrieval of records and it directly associates them to the type of object produced.

So, to summarize. I descend from the row, even though it isn&#039;t as clean, because I want to utilize as much existing functionality from my DAL intact; the Zend Framework developers are better than I. Second, utilizing static accessors directly associates the fetch with the class/model it&#039;s related to and it abstracts the fetch operation in case I decide to change my DAL in the future.]]></description>
		<content:encoded><![CDATA[<p>I need to upload my new BaseModel and write an article about it. For now though, I&#8217;ll address your point.</p>
<p>By your logic, the &#8220;clean&#8221; OO approach should descend from neither the Row or the Table. The DAL should be completely independent. However, I ran into some problems with this approach.</p>
<p>The reason I chose to descend it from Zend_Db_Table_Row because I generally want to interact with individual data objects, or collections there-in. I tried going through the clean OO approach originally, and it resulted in a lot of pass through code. It also broke record collections. In order to support collections coming from Zend, I ended up creating a lot of extra objects. Memory overhead was through the roof and the population algorithms got very expensive.</p>
<p>Another factor is abstraction for the fetching of data objects. I don&#8217;t want to assume that my application will be database based in the future. If I switch to something else, like SOAP or REST based model population, then a Table is no longer relevant. The idea behind the static methods for fetching ONLY is that it abstracts out the retrieval of records and it directly associates them to the type of object produced.</p>
<p>So, to summarize. I descend from the row, even though it isn&#8217;t as clean, because I want to utilize as much existing functionality from my DAL intact; the Zend Framework developers are better than I. Second, utilizing static accessors directly associates the fetch with the class/model it&#8217;s related to and it abstracts the fetch operation in case I decide to change my DAL in the future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dumm Khan</title>
		<link>http://www.littleblackhat.com/blog/2008/05/zend-framework-an-example-model/comment-page-1/#comment-224</link>
		<dc:creator>Dumm Khan</dc:creator>
		<pubDate>Wed, 13 Apr 2011 16:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://littleblackhat.com/blog/?p=9#comment-224</guid>
		<description><![CDATA[I would go for inheriting my Base Model from Zend DB Table, this actually breaks the clean OO approach. Model and DAL should not have an IS-A relationship rather should have a HAS-A relationship.]]></description>
		<content:encoded><![CDATA[<p>I would go for inheriting my Base Model from Zend DB Table, this actually breaks the clean OO approach. Model and DAL should not have an IS-A relationship rather should have a HAS-A relationship.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
