<?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: A Follow-up on the Zend Framework Quickstart Tutorial: The Model</title>
	<atom:link href="http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/</link>
	<description>Wenbert Del Rosario: PHP, MySQL, Javascript, MVC, Zend Framework, AJAX, jQuery.</description>
	<lastBuildDate>Thu, 11 Mar 2010 20:49:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Construyendo capas Models sólidas en MVC Zend Framework &#171; Olagato&#8217;s blog</title>
		<link>http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/comment-page-1/#comment-11705</link>
		<dc:creator>Construyendo capas Models sólidas en MVC Zend Framework &#171; Olagato&#8217;s blog</dc:creator>
		<pubDate>Sun, 26 Jul 2009 17:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/#comment-11705</guid>
		<description>[...] complemeto a esta lectura, está también este otro artículo de Ekini, otro gurú de Zend, donde muestra un ejemplo práctico de codificación de la capa Model [...]</description>
		<content:encoded><![CDATA[<p>[...] complemeto a esta lectura, está también este otro artículo de Ekini, otro gurú de Zend, donde muestra un ejemplo práctico de codificación de la capa Model [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wenbert</title>
		<link>http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/comment-page-1/#comment-11702</link>
		<dc:creator>Wenbert</dc:creator>
		<pubDate>Thu, 23 Jul 2009 02:28:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/#comment-11702</guid>
		<description>... the comments CSS is messed up. I will fix this later. Have to work ;-)</description>
		<content:encoded><![CDATA[<p>&#8230; the comments CSS is messed up. I will fix this later. Have to work ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wenbert</title>
		<link>http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/comment-page-1/#comment-11701</link>
		<dc:creator>Wenbert</dc:creator>
		<pubDate>Thu, 23 Jul 2009 02:26:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/#comment-11701</guid>
		<description>Thanks for taking your time to comment on the mistakes of this article Thai.

I have corrected the
&lt;code&gt;
//$group_model-&gt;save($data);
$group_model-&gt;save();
&lt;/code&gt;

For the init() method, I think FlashMessenger is a built-in view helper that you can use out-of-box. I am using ZF 1.8.x and the FlashMessenger seemed to work when I:
&lt;code&gt;
$this-&gt;_flash_messenger = $this-&gt;_helper-&gt;FlashMessenger;
&lt;/code&gt;

I agree with you. Most of the cases I have encountered, 2 classes is enough. One is a class that extends Zend_Db_Table and another that extends Zend_Db_Table_Abstract. This article is sort of like a follow-up on the &lt;a href=&quot;http://framework.zend.com/docs/quickstart&quot; rel=&quot;nofollow&quot;&gt;Zend Framework Quickstart&lt;/a&gt; which uses 3 different classes for one model. 

It is always good to know other ways of implementing models. I do not have in-depth knowledge of the different design patterns, so this article also serves as a &quot;note&quot; to me when I try to remember things. It is part of my learning process.</description>
		<content:encoded><![CDATA[<p>Thanks for taking your time to comment on the mistakes of this article Thai.</p>
<p>I have corrected the<br />
<code><br />
//$group_model->save($data);<br />
$group_model->save();<br />
</code></p>
<p>For the init() method, I think FlashMessenger is a built-in view helper that you can use out-of-box. I am using ZF 1.8.x and the FlashMessenger seemed to work when I:<br />
<code><br />
$this->_flash_messenger = $this->_helper->FlashMessenger;<br />
</code></p>
<p>I agree with you. Most of the cases I have encountered, 2 classes is enough. One is a class that extends Zend_Db_Table and another that extends Zend_Db_Table_Abstract. This article is sort of like a follow-up on the <a href="http://framework.zend.com/docs/quickstart" rel="nofollow">Zend Framework Quickstart</a> which uses 3 different classes for one model. </p>
<p>It is always good to know other ways of implementing models. I do not have in-depth knowledge of the different design patterns, so this article also serves as a &#8220;note&#8221; to me when I try to remember things. It is part of my learning process.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thai Bui</title>
		<link>http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/comment-page-1/#comment-11699</link>
		<dc:creator>Thai Bui</dc:creator>
		<pubDate>Wed, 22 Jul 2009 20:02:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ekini.net/2009/07/22/a-follow-up-on-the-zend-framework-quickstart-tutorial-the-model/#comment-11699</guid>
		<description>I&#039;ve noticed a lots of mistake in your article, I&#039;ll come from bottom to top:
- function saveAction(), in line $group_model-&gt;save($data), where is $data come from? it should be $this-&gt;save() instead right, cause you already set the attributes for the entity.
- function init(), line $this-&gt;_helper-&gt;FlashMessenger;, again, where is FlashMessenger?
- And what is your intention when split your model into 3 different classes (DAO, DTO and Business Object?).
In my opinion, which such a simple case like that, just 1 or 2 classes is enough, for example:
class Group extends Zend_Db_Table {
    protected $_name = &#039;group&#039;;

    // The most simple case, with out validation
    public function addNewGroup($group){
        $this-&gt;insert($group);
    }

    // A bit more complext, pass and object that already validated
    // The object 
    public function addNewGroup(Default_Model_Group $group){
        $this-&gt;insert(array(
            &#039;name&#039; =&gt; $group-&gt;getName(),
            &#039;description&#039; =&gt; $group-&gt;getDescription()
        ));
    }
}

Then in the controller, it&#039;s more simple than your code, just receive the data, and pass it to the Default_Model_Group or impact it directly into Group without validation.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve noticed a lots of mistake in your article, I&#8217;ll come from bottom to top:<br />
- function saveAction(), in line $group_model-&gt;save($data), where is $data come from? it should be $this-&gt;save() instead right, cause you already set the attributes for the entity.<br />
- function init(), line $this-&gt;_helper-&gt;FlashMessenger;, again, where is FlashMessenger?<br />
- And what is your intention when split your model into 3 different classes (DAO, DTO and Business Object?).<br />
In my opinion, which such a simple case like that, just 1 or 2 classes is enough, for example:<br />
class Group extends Zend_Db_Table {<br />
    protected $_name = &#8216;group&#8217;;</p>
<p>    // The most simple case, with out validation<br />
    public function addNewGroup($group){<br />
        $this-&gt;insert($group);<br />
    }</p>
<p>    // A bit more complext, pass and object that already validated<br />
    // The object<br />
    public function addNewGroup(Default_Model_Group $group){<br />
        $this-&gt;insert(array(<br />
            &#8216;name&#8217; =&gt; $group-&gt;getName(),<br />
            &#8216;description&#8217; =&gt; $group-&gt;getDescription()<br />
        ));<br />
    }<br />
}</p>
<p>Then in the controller, it&#8217;s more simple than your code, just receive the data, and pass it to the Default_Model_Group or impact it directly into Group without validation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
