<?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: What&#8217;s the benefit of the singular/plural conventions in CakePHP?</title>
	<atom:link href="http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 31 Jan 2012 15:12:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-244735</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 22 Nov 2011 15:09:51 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-244735</guid>
		<description>@Shariff: CakePHP uses the class &lt;a href=&quot;http://api.cakephp.org/class/inflector&quot; rel=&quot;nofollow&quot;&gt;Inflector&lt;/a&gt; for this purpose, which also supports irregular singular/plural rules. Plus you can define your own inflection rules, if necessary, as described &lt;a href=&quot;http://book.cakephp.org/view/953/Inflections&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@Shariff: CakePHP uses the class <a href="http://api.cakephp.org/class/inflector" rel="nofollow">Inflector</a> for this purpose, which also supports irregular singular/plural rules. Plus you can define your own inflection rules, if necessary, as described <a href="http://book.cakephp.org/view/953/Inflections" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shariff</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-244128</link>
		<dc:creator>Shariff</dc:creator>
		<pubDate>Tue, 22 Nov 2011 00:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-244128</guid>
		<description>Well, it may sound nice, plural table names, but what if the names are not just suffixed with an s. Like City turns into Cities and then you get City in the singular.</description>
		<content:encoded><![CDATA[<p>Well, it may sound nice, plural table names, but what if the names are not just suffixed with an s. Like City turns into Cities and then you get City in the singular.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-189763</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 02 Feb 2011 15:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-189763</guid>
		<description>@Aeron: Thanks for your comment and for providing links to the documentation!</description>
		<content:encoded><![CDATA[<p>@Aeron: Thanks for your comment and for providing links to the documentation!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aeron</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-189689</link>
		<dc:creator>Aeron</dc:creator>
		<pubDate>Tue, 01 Feb 2011 17:28:17 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-189689</guid>
		<description>This is a silly comment. Cake is a conventions-over-configuration framework. You would use it specifically for it&#039;s conventions.

Also RTFM:
Use your own name:
http://book.cakephp.org/view/1057/Model-Attributes
Define your own conventions:
http://book.cakephp.org/view/953/Inflections

If you want to configure everything yourself Cake is no more work than any other framework. If you want to use Cake&#039;s conventions it is potentially a lot less work.</description>
		<content:encoded><![CDATA[<p>This is a silly comment. Cake is a conventions-over-configuration framework. You would use it specifically for it&#8217;s conventions.</p>
<p>Also RTFM:<br />
Use your own name:<br />
<a href="http://book.cakephp.org/view/1057/Model-Attributes" rel="nofollow">http://book.cakephp.org/view/1057/Model-Attributes</a><br />
Define your own conventions:<br />
<a href="http://book.cakephp.org/view/953/Inflections" rel="nofollow">http://book.cakephp.org/view/953/Inflections</a></p>
<p>If you want to configure everything yourself Cake is no more work than any other framework. If you want to use Cake&#8217;s conventions it is potentially a lot less work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-189681</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 01 Feb 2011 15:26:26 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-189681</guid>
		<description>@Hernando: No, there is no way to tell CakePHP to use your own conventions... CakePHP is an opinionated framework and so it expects you to follow its naming conventions. You can use names not following those conventions, but it won&#039;t make your life easier ;-)

If your conventions use singular/plural but just in another language, you could try to define some inflection rules in app/config/bootstrap.php, though I don&#039;t know how well this works.</description>
		<content:encoded><![CDATA[<p>@Hernando: No, there is no way to tell CakePHP to use your own conventions&#8230; CakePHP is an opinionated framework and so it expects you to follow its naming conventions. You can use names not following those conventions, but it won&#8217;t make your life easier ;-)</p>
<p>If your conventions use singular/plural but just in another language, you could try to define some inflection rules in app/config/bootstrap.php, though I don&#8217;t know how well this works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hernando</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-189602</link>
		<dc:creator>Hernando</dc:creator>
		<pubDate>Mon, 31 Jan 2011 15:52:01 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-189602</guid>
		<description>I work for a non-english company that has his own conventions for the DB table names, and I find really difficult to work with CakePHP fighting with the naming conventions. You should not tie up programmers to your own conventions. I would really apreciate if someone could tell me a way to create my own conventions maybe?</description>
		<content:encoded><![CDATA[<p>I work for a non-english company that has his own conventions for the DB table names, and I find really difficult to work with CakePHP fighting with the naming conventions. You should not tie up programmers to your own conventions. I would really apreciate if someone could tell me a way to create my own conventions maybe?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-111008</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 22 Oct 2008 15:02:43 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-111008</guid>
		<description>@bob: Thanks for your questions!

From my answer to Rafael: &quot;I don’t think we should have a convention of appending “Model” to model names. Models represent concepts of the problem domain, and so it doesn’t make much sense to have names like UserModel, because you will find a User in the problem domain, not a UserModel…&quot; 

On the other hand I think it makes sense to append &quot;Controller&quot; to controllers, as it describes the role of those classes. 

But I know, cake is not that consistent with the naming conventions at the file level. The UsersController class is in a file users_controller.php whereas the class FormHelper is in the file form.php (and not in form_helper.php). Personally I would prefer to have a convention which says: the filename is like the class name, but underscored.

I&#039;m not sure what you mean with your last question. Camel case names are used everywhere with the exception of table and file names. And there I think it makes sense to use underscored names, as it is a common practice. 

Hope that answers your questions!</description>
		<content:encoded><![CDATA[<p>@bob: Thanks for your questions!</p>
<p>From my answer to Rafael: &#8220;I don’t think we should have a convention of appending “Model” to model names. Models represent concepts of the problem domain, and so it doesn’t make much sense to have names like UserModel, because you will find a User in the problem domain, not a UserModel…&#8221; </p>
<p>On the other hand I think it makes sense to append &#8220;Controller&#8221; to controllers, as it describes the role of those classes. </p>
<p>But I know, cake is not that consistent with the naming conventions at the file level. The UsersController class is in a file users_controller.php whereas the class FormHelper is in the file form.php (and not in form_helper.php). Personally I would prefer to have a convention which says: the filename is like the class name, but underscored.</p>
<p>I&#8217;m not sure what you mean with your last question. Camel case names are used everywhere with the exception of table and file names. And there I think it makes sense to use underscored names, as it is a common practice. </p>
<p>Hope that answers your questions!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bob</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-110985</link>
		<dc:creator>bob</dc:creator>
		<pubDate>Wed, 22 Oct 2008 10:51:16 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-110985</guid>
		<description>A non &quot;plural vs singular&quot; question...

If you have NamesController.php, why not NameModel.php?  Or just Name(s).php in the controllers/models folder?

Why do we use camel case only some of the time?</description>
		<content:encoded><![CDATA[<p>A non &#8220;plural vs singular&#8221; question&#8230;</p>
<p>If you have NamesController.php, why not NameModel.php?  Or just Name(s).php in the controllers/models folder?</p>
<p>Why do we use camel case only some of the time?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rafaelbandeira3</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-110851</link>
		<dc:creator>rafaelbandeira3</dc:creator>
		<pubDate>Tue, 21 Oct 2008 11:10:01 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-110851</guid>
		<description>@cakebaker: no, you actually putted it very well - as usually - and I had changed my mind about the prefixing stuff... ;-)</description>
		<content:encoded><![CDATA[<p>@cakebaker: no, you actually putted it very well &#8211; as usually &#8211; and I had changed my mind about the prefixing stuff&#8230; ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/10/15/whats-the-benefit-of-the-singularplural-conventions-in-cakephp/comment-page-1/#comment-110733</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Mon, 20 Oct 2008 15:30:14 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=852#comment-110733</guid>
		<description>@Mark: Thanks for your comment!

Yes, that&#039;s true, there are two different camps regarding this topic. The article &lt;a href=&quot;http://www.breaksoft.com/Blog/Posts/2004/9/Plural_vs_Singular_Table_Names.aspx&quot; rel=&quot;nofollow&quot;&gt;Plural vs Singular Table Names&lt;/a&gt; lists the advantages of both approaches.</description>
		<content:encoded><![CDATA[<p>@Mark: Thanks for your comment!</p>
<p>Yes, that&#8217;s true, there are two different camps regarding this topic. The article <a href="http://www.breaksoft.com/Blog/Posts/2004/9/Plural_vs_Singular_Table_Names.aspx" rel="nofollow">Plural vs Singular Table Names</a> lists the advantages of both approaches.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

