<?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: On models in a Zend Framework application</title>
	<atom:link href="http://akrabat.com/js/on-models-in-a-zend-framework-application/feed/" rel="self" type="application/rss+xml" />
	<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/</link>
	<description>Developing PHP software in the Real World, by Rob Allen</description>
	<lastBuildDate>Mon, 15 Mar 2010 21:29:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Brett Kromkamp</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-28670</link>
		<dc:creator>Brett Kromkamp</dc:creator>
		<pubDate>Sun, 04 Oct 2009 21:01:06 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-28670</guid>
		<description>I have developed an application to manage and organize knowledge based on topic maps with the Zend Framework: http://www.quesucede.com. The Zend Framework was both very productive and relatively easy to use.</description>
		<content:encoded><![CDATA[<p>I have developed an application to manage and organize knowledge based on topic maps with the Zend Framework: <a href="http://www.quesucede.com" rel="nofollow">http://www.quesucede.com</a>. The Zend Framework was both very productive and relatively easy to use.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giorgio Sironi</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-27965</link>
		<dc:creator>Giorgio Sironi</dc:creator>
		<pubDate>Mon, 20 Jul 2009 19:10:12 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-27965</guid>
		<description>It is not banal: you have to resort to an Orm.</description>
		<content:encoded><![CDATA[<p>It is not banal: you have to resort to an Orm.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-27961</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Mon, 20 Jul 2009 15:25:48 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-27961</guid>
		<description>While I think I sorta get the idea behind this, it seems that this approach falls short when you need to build more complex queries using joins.  All of the examples I have seen deal only with a single table using 1:1 mappings.  Can someone please explain how you would go about modifying this approach to use multiple tables with joins?

Sorry if this question seems &quot;noobish&quot;.

Thanks in advance!
Matt</description>
		<content:encoded><![CDATA[<p>While I think I sorta get the idea behind this, it seems that this approach falls short when you need to build more complex queries using joins.  All of the examples I have seen deal only with a single table using 1:1 mappings.  Can someone please explain how you would go about modifying this approach to use multiple tables with joins?</p>
<p>Sorry if this question seems "noobish".</p>
<p>Thanks in advance!<br />
Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colleen Dick</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-27072</link>
		<dc:creator>Colleen Dick</dc:creator>
		<pubDate>Sat, 30 May 2009 05:26:04 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-27072</guid>
		<description>My last big project involved extremely complex objects composed of gobs of tables.  It wasn&#039;t Zend but it was MVC.  I had lotsa code in the models and it turned me into a disbeliever in strict ORM, but there was no abstract factoring of common gateway functionality partly cuz it was in PHP4 and partly cuz I never expected it to get so complicated.   So now I have to decide whether I can remember these wrappers long enough to write models on top of them.</description>
		<content:encoded><![CDATA[<p>My last big project involved extremely complex objects composed of gobs of tables.  It wasn't Zend but it was MVC.  I had lotsa code in the models and it turned me into a disbeliever in strict ORM, but there was no abstract factoring of common gateway functionality partly cuz it was in PHP4 and partly cuz I never expected it to get so complicated.   So now I have to decide whether I can remember these wrappers long enough to write models on top of them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colleen Dick</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-27064</link>
		<dc:creator>Colleen Dick</dc:creator>
		<pubDate>Sat, 30 May 2009 00:26:30 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-27064</guid>
		<description>Has_a instead of Is_a wherever we can, favor composition over inheritance is what Kathy Sierra taught me.  Thanks for this excellent elaboration.</description>
		<content:encoded><![CDATA[<p>Has_a instead of Is_a wherever we can, favor composition over inheritance is what Kathy Sierra taught me.  Thanks for this excellent elaboration.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fábio T. da Costa</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-26642</link>
		<dc:creator>Fábio T. da Costa</dc:creator>
		<pubDate>Tue, 19 May 2009 13:02:22 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-26642</guid>
		<description>And about App_Db_Table_Row_Standard? Can you show the code of this class?

Thanks...</description>
		<content:encoded><![CDATA[<p>And about App_Db_Table_Row_Standard? Can you show the code of this class?</p>
<p>Thanks...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roy simkes</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-26359</link>
		<dc:creator>roy simkes</dc:creator>
		<pubDate>Tue, 12 May 2009 15:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-26359</guid>
		<description>I guess it&#039;s a Java-like approach, force developer to do the right thing because he might not always be at a good state to do the right thing :)

I do not completely agree with the idea, because I believe a developer must be an intelligent guy. After reading something like this on Matthew Weier O&#039;Phinney&#039;s blog, I guess I understood better of what we are trying to do here. It&#039;s not only about hiding Zend_Db, because we are not only talking about one model here. I was thinking like that (there is only user and nothing else), but there is also a list of users and some other things too. So you should be able to hide them too and this is what you are doing. Thanks for the reply.</description>
		<content:encoded><![CDATA[<p>I guess it's a Java-like approach, force developer to do the right thing because he might not always be at a good state to do the right thing :)</p>
<p>I do not completely agree with the idea, because I believe a developer must be an intelligent guy. After reading something like this on Matthew Weier O'Phinney's blog, I guess I understood better of what we are trying to do here. It's not only about hiding Zend_Db, because we are not only talking about one model here. I was thinking like that (there is only user and nothing else), but there is also a list of users and some other things too. So you should be able to hide them too and this is what you are doing. Thanks for the reply.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob...</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-26358</link>
		<dc:creator>Rob...</dc:creator>
		<pubDate>Tue, 12 May 2009 15:08:53 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-26358</guid>
		<description>Roy,

In my experience, it requires a lot of self-discipline to not do stuff in the controller that should be in the model. With a team of programmers of varying abilities, it&#039;s best to make it extremely hard to do it wrong.

Regards,

Rob...</description>
		<content:encoded><![CDATA[<p>Roy,</p>
<p>In my experience, it requires a lot of self-discipline to not do stuff in the controller that should be in the model. With a team of programmers of varying abilities, it's best to make it extremely hard to do it wrong.</p>
<p>Regards,</p>
<p>Rob...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: roy simkes</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-26340</link>
		<dc:creator>roy simkes</dc:creator>
		<pubDate>Tue, 12 May 2009 10:07:52 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-26340</guid>
		<description>Hi,

It might be a pretty dumb question to ask, but why the extra effort to create lots of classes and extending them to hide Zend_db from your application individually.

The problem IMHO, is to hide Zend_Db from your application. And when I mean Zend_Db I talk about everything. Preventing the usage of it&#039;s methods, like select or something, somewhere else then your models, because you might need to move on from connecting to databases to a web service to get your data.

So All we need to do is creating methods on my models and only using them to get/save/update data. About more than one tables, if you start writing your own queries in your model, you will write every query you want. The next problem occurs because of usage of Zend_Db_Table&#039;s methods like fetch which returns a Zend_Db_Table_Row or equivalent. When you start to write your own sql queries, you can tell to fetch results to Objects, which then creates a php built-in StandardObject.

No need to create lots of extra classes and lines of code to hide all the zend_db layers individually. My approach is basically hiding everything behind one model, which is used everywhere in my application. 

I understand that the model here is the next iteration of my approach. With adding extra abilities to the StandartObject and basically improving it&#039;s usage (like adding save or update features (powers?) on it, I do this with a save method on my model which takes an associative array and executes an update/insert statement).

The model here might be a better OOP approach too, I just want to figure out why all the extra work?

Sorry if my question is very dumb and noobish.

thanks</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>It might be a pretty dumb question to ask, but why the extra effort to create lots of classes and extending them to hide Zend_db from your application individually.</p>
<p>The problem IMHO, is to hide Zend_Db from your application. And when I mean Zend_Db I talk about everything. Preventing the usage of it's methods, like select or something, somewhere else then your models, because you might need to move on from connecting to databases to a web service to get your data.</p>
<p>So All we need to do is creating methods on my models and only using them to get/save/update data. About more than one tables, if you start writing your own queries in your model, you will write every query you want. The next problem occurs because of usage of Zend_Db_Table's methods like fetch which returns a Zend_Db_Table_Row or equivalent. When you start to write your own sql queries, you can tell to fetch results to Objects, which then creates a php built-in StandardObject.</p>
<p>No need to create lots of extra classes and lines of code to hide all the zend_db layers individually. My approach is basically hiding everything behind one model, which is used everywhere in my application. </p>
<p>I understand that the model here is the next iteration of my approach. With adding extra abilities to the StandartObject and basically improving it's usage (like adding save or update features (powers?) on it, I do this with a save method on my model which takes an associative array and executes an update/insert statement).</p>
<p>The model here might be a better OOP approach too, I just want to figure out why all the extra work?</p>
<p>Sorry if my question is very dumb and noobish.</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: F@bio</title>
		<link>http://akrabat.com/js/on-models-in-a-zend-framework-application/#comment-25529</link>
		<dc:creator>F@bio</dc:creator>
		<pubDate>Wed, 22 Apr 2009 19:37:17 +0000</pubDate>
		<guid isPermaLink="false">http://akrabat.com/?p=322#comment-25529</guid>
		<description>The example of your model design consists of one table, as far as I understood. Which doesn&#039;t explain to me how this model could serve &quot;two or more database tables to do its work&quot;. Could you provide a short example for UserPets for instance ?</description>
		<content:encoded><![CDATA[<p>The example of your model design consists of one table, as far as I understood. Which doesn't explain to me how this model could serve "two or more database tables to do its work". Could you provide a short example for UserPets for instance ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
