<?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: ASP.NET MVC TIP &#8211; Keep your controllers and actions thin</title>
	<atom:link href="http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/</link>
	<description></description>
	<lastBuildDate>Sun, 14 Mar 2010 19:34:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: C.T.</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-198290</link>
		<dc:creator>C.T.</dc:creator>
		<pubDate>Fri, 20 Nov 2009 09:43:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-198290</guid>
		<description>What I used in several real websites is like this:
a project inclues DAL, BLL and BO
the other project is a website project having
Controller
View
etc.

i feel many times,  a contoller need data/objects from different BLLs. and in some *controllers, i have to organize different data/objects, especially in POST *controllers, i have to write many codes to validate data.

this made me headache, i want to thin the *controllers, but have not found a way to seperate the logic in the controllers.

if it is possible that move most CONTROLLER logic to  the MODEL layer?</description>
		<content:encoded><![CDATA[<p>What I used in several real websites is like this:<br />
a project inclues DAL, BLL and BO<br />
the other project is a website project having<br />
Controller<br />
View<br />
etc.</p>
<p>i feel many times,  a contoller need data/objects from different BLLs. and in some *controllers, i have to organize different data/objects, especially in POST *controllers, i have to write many codes to validate data.</p>
<p>this made me headache, i want to thin the *controllers, but have not found a way to seperate the logic in the controllers.</p>
<p>if it is possible that move most CONTROLLER logic to  the MODEL layer?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rokey</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-189599</link>
		<dc:creator>rokey</dc:creator>
		<pubDate>Mon, 30 Mar 2009 11:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-189599</guid>
		<description>I&#039;m having my controller do the eager loading (since im using EF for model), and the error checking in the POST controllers...

Does that mean a gigantic model class that provides different methods for loading same entity object with different combinations of relations?</description>
		<content:encoded><![CDATA[<p>I&#8217;m having my controller do the eager loading (since im using EF for model), and the error checking in the POST controllers&#8230;</p>
<p>Does that mean a gigantic model class that provides different methods for loading same entity object with different combinations of relations?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy Kelly</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-189196</link>
		<dc:creator>Tommy Kelly</dc:creator>
		<pubDate>Tue, 17 Mar 2009 14:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-189196</guid>
		<description>Matthew, I am using a service layer that transforms my business objects into DTO&#039;s for my controllers.  This makes less code in the controllers, where its somewhat harder to test.  I find it works well for my project.</description>
		<content:encoded><![CDATA[<p>Matthew, I am using a service layer that transforms my business objects into DTO&#8217;s for my controllers.  This makes less code in the controllers, where its somewhat harder to test.  I find it works well for my project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Pelser</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-189194</link>
		<dc:creator>Matthew Pelser</dc:creator>
		<pubDate>Tue, 17 Mar 2009 11:19:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-189194</guid>
		<description>At some point you need to make multiple calls to the multiple models and then operate on these different result sets and return some sort of transformed output.

Do you find that you end up with model classes calling other model classes for this output or is this another layer? Maybe the &quot;MyService&quot; layer in your example that ends up being a fat &quot;model controller&quot; that stitches and transforms the finer grained &quot;Get&quot; calls together.

I totally see the value of having the controller class having the sole responsibility for attaching the model to the view, but you have to push the logic somewhere. The model layer feels like fine grained query layer to me not a “Business” (yuk) layer.</description>
		<content:encoded><![CDATA[<p>At some point you need to make multiple calls to the multiple models and then operate on these different result sets and return some sort of transformed output.</p>
<p>Do you find that you end up with model classes calling other model classes for this output or is this another layer? Maybe the &#8220;MyService&#8221; layer in your example that ends up being a fat &#8220;model controller&#8221; that stitches and transforms the finer grained &#8220;Get&#8221; calls together.</p>
<p>I totally see the value of having the controller class having the sole responsibility for attaching the model to the view, but you have to push the logic somewhere. The model layer feels like fine grained query layer to me not a “Business” (yuk) layer.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-189176</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Mon, 16 Mar 2009 16:02:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-189176</guid>
		<description>Glen: When I say &quot;thin&quot; read that as &quot;as thin as possible&quot;. You don&#039;t want your controller to just turn into a routing rule. Sometimes you&#039;ll need to put a little bit of logic in the controllers. I&#039;ll cover one such case a little later in the week. :)</description>
		<content:encoded><![CDATA[<p>Glen: When I say &#8220;thin&#8221; read that as &#8220;as thin as possible&#8221;. You don&#8217;t want your controller to just turn into a routing rule. Sometimes you&#8217;ll need to put a little bit of logic in the controllers. I&#8217;ll cover one such case a little later in the week. <img src='http://www.lazycoder.com/weblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hernan Garcia</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-189175</link>
		<dc:creator>Hernan Garcia</dc:creator>
		<pubDate>Mon, 16 Mar 2009 15:58:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-189175</guid>
		<description>Or we may risk to make the controller another code behind hell.</description>
		<content:encoded><![CDATA[<p>Or we may risk to make the controller another code behind hell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simone</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-189173</link>
		<dc:creator>Simone</dc:creator>
		<pubDate>Mon, 16 Mar 2009 15:45:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-189173</guid>
		<description>Totally agree....
There is a tenet in the RoR world that says:
&quot;Skinny controllers, Fat Model and... Dumb view&quot;</description>
		<content:encoded><![CDATA[<p>Totally agree&#8230;.<br />
There is a tenet in the <acronym title='Ruby on Rails'><span class='caps'>RoR</span></acronym> world that says:<br />
&#8220;Skinny controllers, Fat Model and&#8230; Dumb view&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoffrey</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-189172</link>
		<dc:creator>Geoffrey</dc:creator>
		<pubDate>Mon, 16 Mar 2009 15:42:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-189172</guid>
		<description>I agree totally to your suggestion, and actully have a very similar style to implement my controllers. 

Continuing on Glen&#039;s statement, which imo does make sense, there should be an even cleaner way. I&#039;d almost say something like events or delegates.</description>
		<content:encoded><![CDATA[<p>I agree totally to your suggestion, and actully have a very similar style to implement my controllers. </p>
<p>Continuing on Glen&#8217;s statement, which imo does make sense, there should be an even cleaner way. I&#8217;d almost say something like events or delegates.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glen</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-189170</link>
		<dc:creator>Glen</dc:creator>
		<pubDate>Mon, 16 Mar 2009 15:35:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-189170</guid>
		<description>If this is true, then the controller is actually just overhead code and should not be needed.

Is there a way to do what these controllers are doing, by attributes or shared names?</description>
		<content:encoded><![CDATA[<p>If this is true, then the controller is actually just overhead code and should not be needed.</p>
<p>Is there a way to do what these controllers are doing, by attributes or shared names?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derik Whittaker</title>
		<link>http://www.lazycoder.com/weblog/2009/03/16/aspnet-mvc-tip-keep-your-controllers-and-actions-thin/comment-page-1/#comment-189169</link>
		<dc:creator>Derik Whittaker</dc:creator>
		<pubDate>Mon, 16 Mar 2009 15:31:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.lazycoder.com/weblog/?p=1110#comment-189169</guid>
		<description>This should not be a tip, it should be a mandate</description>
		<content:encoded><![CDATA[<p>This should not be a tip, it should be a mandate</p>
]]></content:encoded>
	</item>
</channel>
</rss>
