<?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: Named finder methods</title>
	<atom:link href="http://cakebaker.42dh.com/2008/07/04/named-finder-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Wed, 17 Mar 2010 14:11:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-98661</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 16 Jul 2008 16:59:36 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-98661</guid>
		<description>@iamjhlee: I&#039;m glad it is useful for you. I hope you also read Brandon&#039;s comment about the possible problems of using this approach.</description>
		<content:encoded><![CDATA[<p>@iamjhlee: I&#8217;m glad it is useful for you. I hope you also read Brandon&#8217;s comment about the possible problems of using this approach.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iamjhlee</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-98531</link>
		<dc:creator>iamjhlee</dc:creator>
		<pubDate>Wed, 16 Jul 2008 02:18:19 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-98531</guid>
		<description>This is useful to make something more organized for me.
If I need to change something for a general condition, I can change in $actAs, and also this will helps me easily on a big application,

Thanks, cakebaker</description>
		<content:encoded><![CDATA[<p>This is useful to make something more organized for me.<br />
If I need to change something for a general condition, I can change in $actAs, and also this will helps me easily on a big application,</p>
<p>Thanks, cakebaker</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-97827</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 10 Jul 2008 15:00:25 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-97827</guid>
		<description>@speedmax: Thanks for your comment! Yes, the chaining of scope finders is quite cool and elegant.</description>
		<content:encoded><![CDATA[<p>@speedmax: Thanks for your comment! Yes, the chaining of scope finders is quite cool and elegant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: speedmax</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-97791</link>
		<dc:creator>speedmax</dc:creator>
		<pubDate>Thu, 10 Jul 2008 04:48:27 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-97791</guid>
		<description>same here recently enjoying rails&#039; named_scope... 

Well, its possible for such NamedFinder behavior in CakePHP, i may even check it out when i have time.. 

However, i think the killer feature in rails one is the way ActiveRecord maintained scope can pass over..  
ie, 3 named scope finder chained. 
  Product.recent.cheap.downloadable
The video on railscast talks about the named_scope thingy.. 

Anyway, Its very cool dho ... such a easy way to declare finder now..

may be one day, it&#039;s possible to port ActiveRecord::base.with_scope over to cake</description>
		<content:encoded><![CDATA[<p>same here recently enjoying rails&#8217; named_scope&#8230; </p>
<p>Well, its possible for such NamedFinder behavior in CakePHP, i may even check it out when i have time.. </p>
<p>However, i think the killer feature in rails one is the way ActiveRecord maintained scope can pass over..<br />
ie, 3 named scope finder chained.<br />
  Product.recent.cheap.downloadable<br />
The video on railscast talks about the named_scope thingy.. </p>
<p>Anyway, Its very cool dho &#8230; such a easy way to declare finder now..</p>
<p>may be one day, it&#8217;s possible to port ActiveRecord::base.with_scope over to cake</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-97687</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 08 Jul 2008 17:00:12 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-97687</guid>
		<description>@Abhimanyu, Brandon: Thanks for your comments!

@Abhimanyu: Thanks, I&#039;m glad it is useful for you!

@Brandon: I agree with you that you have to be careful with using such concepts. And as you can see from the article, I&#039;m not fully convinced it&#039;s a good idea to use the behavior I wrote ;-)

The scenario for which I think it could be useful is when you have conditions you want to use in different combinations. But even then you could encapsulate those conditions in private methods and merge them when they are used.

So, in general it is probably better NOT to use this behavior ;-)</description>
		<content:encoded><![CDATA[<p>@Abhimanyu, Brandon: Thanks for your comments!</p>
<p>@Abhimanyu: Thanks, I&#8217;m glad it is useful for you!</p>
<p>@Brandon: I agree with you that you have to be careful with using such concepts. And as you can see from the article, I&#8217;m not fully convinced it&#8217;s a good idea to use the behavior I wrote ;-)</p>
<p>The scenario for which I think it could be useful is when you have conditions you want to use in different combinations. But even then you could encapsulate those conditions in private methods and merge them when they are used.</p>
<p>So, in general it is probably better NOT to use this behavior ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon P</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-97683</link>
		<dc:creator>Brandon P</dc:creator>
		<pubDate>Tue, 08 Jul 2008 16:09:11 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-97683</guid>
		<description>@Abhimanyu:

I suggested writing an actual function.  I think it&#039;s bad to have this long &quot;config&quot; style implementation to hide functionality:

function findPending()
{
return $this-&gt;find(&#039;all&#039;, array(&#039;conditions&#039; =&gt; array(&#039;User.is_pending&#039; =&gt; &#039;1&#039;)));
}

What&#039;s so bad about that? :) It takes LESS time to write (you don&#039;t have to include the behavior). Plus, this way the function is listed in any API and can be indexed by your IDE for quick variable reference.  Otherwise, there is no way to know that such a function exists.  And believe me, if you have a large project you will forget the function is there if it&#039;s not concretely defined.</description>
		<content:encoded><![CDATA[<p>@Abhimanyu:</p>
<p>I suggested writing an actual function.  I think it&#8217;s bad to have this long &#8220;config&#8221; style implementation to hide functionality:</p>
<p>function findPending()<br />
{<br />
return $this-&gt;find(&#8216;all&#8217;, array(&#8216;conditions&#8217; =&gt; array(&#8216;User.is_pending&#8217; =&gt; &#8216;1&#8242;)));<br />
}</p>
<p>What&#8217;s so bad about that? :) It takes LESS time to write (you don&#8217;t have to include the behavior). Plus, this way the function is listed in any API and can be indexed by your IDE for quick variable reference.  Otherwise, there is no way to know that such a function exists.  And believe me, if you have a large project you will forget the function is there if it&#8217;s not concretely defined.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhimanyu</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-97663</link>
		<dc:creator>Abhimanyu</dc:creator>
		<pubDate>Tue, 08 Jul 2008 11:41:49 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-97663</guid>
		<description>@Brandon: If you are working on a project, which acts as a base to all of your projects, I dont see a negative effect of following this way. Infact, this solution provides re-usability and saves you from writing additional 2-3 lines everytime. 

$this-&gt;User-&gt;findPending(); is much better than those of magic constant statements like these:
$this-&gt;User-&gt;findAll(array(&#039;User.status&#039;=&gt;0));

Basically this is your toolset, its upto you how you use it. You can make things simpler and complex at both times.</description>
		<content:encoded><![CDATA[<p>@Brandon: If you are working on a project, which acts as a base to all of your projects, I dont see a negative effect of following this way. Infact, this solution provides re-usability and saves you from writing additional 2-3 lines everytime. </p>
<p>$this-&gt;User-&gt;findPending(); is much better than those of magic constant statements like these:<br />
$this-&gt;User-&gt;findAll(array(&#8216;User.status&#8217;=&gt;0));</p>
<p>Basically this is your toolset, its upto you how you use it. You can make things simpler and complex at both times.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon P</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-97611</link>
		<dc:creator>Brandon P</dc:creator>
		<pubDate>Mon, 07 Jul 2008 15:31:45 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-97611</guid>
		<description>I worry that concepts like this lead programmers to be more sloppy and lazy.  It doesn&#039;t make sense to me to create MORE of these &quot;magic&quot; functions that hide real functionality.

IMO, this concept just adds another layer of code that needs to be maintained and executed at runtime to essentially &quot;mimic&quot; a hardcoded function.  It&#039;s like you are trying to abstract code that&#039;s already abstract. :)

It would take you LESS time to simply define a function and return a $this-&gt;find() statement.  Maintaining code that is mixed with hardcoded methods and these &quot;magic&quot; ones would be a nightmare!

I think a quick pro/con list of using this behavior would help programmers make a more educated decision whether or not to include this type of behavior.</description>
		<content:encoded><![CDATA[<p>I worry that concepts like this lead programmers to be more sloppy and lazy.  It doesn&#8217;t make sense to me to create MORE of these &#8220;magic&#8221; functions that hide real functionality.</p>
<p>IMO, this concept just adds another layer of code that needs to be maintained and executed at runtime to essentially &#8220;mimic&#8221; a hardcoded function.  It&#8217;s like you are trying to abstract code that&#8217;s already abstract. :)</p>
<p>It would take you LESS time to simply define a function and return a $this-&gt;find() statement.  Maintaining code that is mixed with hardcoded methods and these &#8220;magic&#8221; ones would be a nightmare!</p>
<p>I think a quick pro/con list of using this behavior would help programmers make a more educated decision whether or not to include this type of behavior.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2008-07-07 &#171; Richard@Home</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-97579</link>
		<dc:creator>links for 2008-07-07 &#171; Richard@Home</dc:creator>
		<pubDate>Mon, 07 Jul 2008 05:30:14 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-97579</guid>
		<description>[...] Named finder methods - cakebaker (tags: cakephp behavior finder) [...]</description>
		<content:encoded><![CDATA[<p>[...] Named finder methods &#8211; cakebaker (tags: cakephp behavior finder) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhimanyu Grover</title>
		<link>http://cakebaker.42dh.com/2008/07/04/named-finder-methods/comment-page-1/#comment-97446</link>
		<dc:creator>Abhimanyu Grover</dc:creator>
		<pubDate>Sat, 05 Jul 2008 21:55:53 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=609#comment-97446</guid>
		<description>Excellent man!!!... just what I need. Adding it to my CMS project coming Monday. I liked the support of &#039;And&#039;... Nice work.</description>
		<content:encoded><![CDATA[<p>Excellent man!!!&#8230; just what I need. Adding it to my CMS project coming Monday. I liked the support of &#8216;And&#8217;&#8230; Nice work.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
