<?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: An alternative approach for organizing your controllers</title>
	<atom:link href="http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/</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/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-3760</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 30 Jan 2007 09:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-3760</guid>
		<description>@Roger: Thanks for your comment.

Yes, you are right, it is a bad idea to design an application only for providing nice urls. But if you think this idea further, you will end up with a &quot;perfect&quot; system, at least in theory. Each controller would have just one method which handles the respective action for all models. And as the framework would provide the actions for crud operations, you would have to write much less code...

But back to reality. Yes, you are right, something like /edit/user/1 wouldn&#039;t be natural for all languages.</description>
		<content:encoded><![CDATA[<p>@Roger: Thanks for your comment.</p>
<p>Yes, you are right, it is a bad idea to design an application only for providing nice urls. But if you think this idea further, you will end up with a &#8220;perfect&#8221; system, at least in theory. Each controller would have just one method which handles the respective action for all models. And as the framework would provide the actions for crud operations, you would have to write much less code&#8230;</p>
<p>But back to reality. Yes, you are right, something like /edit/user/1 wouldn&#8217;t be natural for all languages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Lancefield</title>
		<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-3695</link>
		<dc:creator>Roger Lancefield</dc:creator>
		<pubDate>Mon, 29 Jan 2007 11:38:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-3695</guid>
		<description>In my view, if you are changing the structure or organization of your application for valid architectural/design philosophy reasons, that&#039;s one thing, but to do so just to achieve prettier URLs is allowing the tail to wag the dog. That is, by all means adopt the command pattern if it&#039;s useful, but not to prettify URLs! To do so would be altering the inherent design philosophy of your application for the most trivial reasons. An application&#039;s design should aim to achieve modularity, clarity, coherence, maintainability, performance, etc. etc. but not to churn out easy to read URLs.  That&#039;s why the gods gave us mod_rewrite isn&#039;t it? :)

Another point, it&#039;s worth bearing in mind that not all natural languages use the SVO (subject-verb-object) syntax that English uses. E.g. for speakers of Japanese, Tibetan, Turkish and Navajo, /users/edit should look just fine. More good reasons why URL structure should &#039;float free&#039; from application design methinks.

Anyway, great CakePHP blog. Cheers!</description>
		<content:encoded><![CDATA[<p>In my view, if you are changing the structure or organization of your application for valid architectural/design philosophy reasons, that&#8217;s one thing, but to do so just to achieve prettier URLs is allowing the tail to wag the dog. That is, by all means adopt the command pattern if it&#8217;s useful, but not to prettify URLs! To do so would be altering the inherent design philosophy of your application for the most trivial reasons. An application&#8217;s design should aim to achieve modularity, clarity, coherence, maintainability, performance, etc. etc. but not to churn out easy to read URLs.  That&#8217;s why the gods gave us mod_rewrite isn&#8217;t it? :)</p>
<p>Another point, it&#8217;s worth bearing in mind that not all natural languages use the SVO (subject-verb-object) syntax that English uses. E.g. for speakers of Japanese, Tibetan, Turkish and Navajo, /users/edit should look just fine. More good reasons why URL structure should &#8216;float free&#8217; from application design methinks.</p>
<p>Anyway, great CakePHP blog. Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-570</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 11 Jul 2006 09:36:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-570</guid>
		<description>@olegs: I am not sure what you mean with your comment. According to my statements in this post the urls would look like:

/edit/item/34/category/12

and

/edit/category/12</description>
		<content:encoded><![CDATA[<p>@olegs: I am not sure what you mean with your comment. According to my statements in this post the urls would look like:</p>
<p>/edit/item/34/category/12</p>
<p>and</p>
<p>/edit/category/12</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: olegs</title>
		<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-563</link>
		<dc:creator>olegs</dc:creator>
		<pubDate>Sat, 08 Jul 2006 18:56:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-563</guid>
		<description>For more complex cases:

Edit item 34 in category 12 :

/categories/12/edit/item/34 ?

edit category 12:

/categories/edit/12 ????</description>
		<content:encoded><![CDATA[<p>For more complex cases:</p>
<p>Edit item 34 in category 12 :</p>
<p>/categories/12/edit/item/34 ?</p>
<p>edit category 12:</p>
<p>/categories/edit/12 ????</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-562</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 06 Jul 2006 17:05:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-562</guid>
		<description>@all: thanks for your comments and ideas. I will keep experimenting :)</description>
		<content:encoded><![CDATA[<p>@all: thanks for your comments and ideas. I will keep experimenting :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uzyn</title>
		<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-561</link>
		<dc:creator>uzyn</dc:creator>
		<pubDate>Wed, 05 Jul 2006 15:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-561</guid>
		<description>Very interesting idea.

But wouldn&#039;t that means breaking the MVC model? I admit I did think about the same issues as well, but usually I would simply use routing for that.

But interesting idea anyway. Gives a different perspective to the whole MVC.</description>
		<content:encoded><![CDATA[<p>Very interesting idea.</p>
<p>But wouldn&#8217;t that means breaking the MVC model? I admit I did think about the same issues as well, but usually I would simply use routing for that.</p>
<p>But interesting idea anyway. Gives a different perspective to the whole MVC.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felix Geisendörfer</title>
		<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-560</link>
		<dc:creator>Felix Geisendörfer</dc:creator>
		<pubDate>Wed, 05 Jul 2006 08:22:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-560</guid>
		<description>I sometimes feel like messing with the url&#039;s as well, in fact right now I&#039;m working on a UrlAlias Model that&#039;ll be released soon.

Most of the times I feel the most flexible approach is to modify the $from_url variable in the routes.php. So in this case you would explode the $from_url on &#039;/&#039;, check if a controller with the name second item of the resulting array exists, and if this controller has an action named like the first item of the array. If that&#039;s the case you simply switch those two arguments in your $from_url, and voilá you got yourself a new url convention.

I think using something like an EditController would be a rather confusing setup, but well, it might offers some other advantages like better refactoring of edit related code, who knows.

Just my ideas ; )</description>
		<content:encoded><![CDATA[<p>I sometimes feel like messing with the url&#8217;s as well, in fact right now I&#8217;m working on a UrlAlias Model that&#8217;ll be released soon.</p>
<p>Most of the times I feel the most flexible approach is to modify the $from_url variable in the routes.php. So in this case you would explode the $from_url on &#8216;/&#8217;, check if a controller with the name second item of the resulting array exists, and if this controller has an action named like the first item of the array. If that&#8217;s the case you simply switch those two arguments in your $from_url, and voilá you got yourself a new url convention.</p>
<p>I think using something like an EditController would be a rather confusing setup, but well, it might offers some other advantages like better refactoring of edit related code, who knows.</p>
<p>Just my ideas ; )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Pearce</title>
		<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-569</link>
		<dc:creator>Brandon Pearce</dc:creator>
		<pubDate>Tue, 04 Jul 2006 20:07:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-569</guid>
		<description>One other issue is that if all you&#039;re doing is updating a single table, then you really don&#039;t need a separate edit() function for each model. Kind of like scaffolding, I have a save() function in app_controller that I use to save all my models unless there is something special I need to do. With this new suggestion, I would need to create an extra function to save every model even if it uses the same code as another model. (True I could just call the other function, but it&#039;s still extra code).

Fun to think about, though. Thanks for the idea.</description>
		<content:encoded><![CDATA[<p>One other issue is that if all you&#8217;re doing is updating a single table, then you really don&#8217;t need a separate edit() function for each model. Kind of like scaffolding, I have a save() function in app_controller that I use to save all my models unless there is something special I need to do. With this new suggestion, I would need to create an extra function to save every model even if it uses the same code as another model. (True I could just call the other function, but it&#8217;s still extra code).</p>
<p>Fun to think about, though. Thanks for the idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KesheR</title>
		<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-568</link>
		<dc:creator>KesheR</dc:creator>
		<pubDate>Tue, 04 Jul 2006 18:45:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-568</guid>
		<description>Mmmmm I like the way it is, I don&#039;t need it :)</description>
		<content:encoded><![CDATA[<p>Mmmmm I like the way it is, I don&#8217;t need it :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nate</title>
		<link>http://cakebaker.42dh.com/2006/07/04/an-alternative-approach-for-organizing-your-controllers/comment-page-1/#comment-564</link>
		<dc:creator>nate</dc:creator>
		<pubDate>Tue, 04 Jul 2006 16:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.cakebaker.42dh.com/?p=220#comment-564</guid>
		<description>Actually, any one of those scenarios is possible to do with routes.</description>
		<content:encoded><![CDATA[<p>Actually, any one of those scenarios is possible to do with routes.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

