<?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: Single Action Controllers with ASP.Net MVC</title>
	<atom:link href="http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/</link>
	<description>pursuing well-crafted software</description>
	<lastBuildDate>Tue, 14 May 2013 13:08:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Cleaning up your MVC controllers &#171; Philly ALT.NET</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-324</link>
		<dc:creator>Cleaning up your MVC controllers &#171; Philly ALT.NET</dc:creator>
		<pubDate>Fri, 03 Feb 2012 14:53:50 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-324</guid>
		<description>[...] http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/ http://devlicio.us/blogs/casey/archive/2011/07/11/single-action-per-controller-in-asp-net-mvc.asp Share this:TwitterFacebookLike this:LikeBe the first to like this post.   Uncategorized    &#8592; February 9, 2012 Meeting &#8211; Asynchronous&#160;Programming [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/" rel="nofollow">http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/</a> <a href="http://devlicio.us/blogs/casey/archive/2011/07/11/single-action-per-controller-in-asp-net-mvc.asp" rel="nofollow">http://devlicio.us/blogs/casey/archive/2011/07/11/single-action-per-controller-in-asp-net-mvc.asp</a> Share this:TwitterFacebookLike this:LikeBe the first to like this post.   Uncategorized    &larr; February 9, 2012 Meeting &#8211; Asynchronous&nbsp;Programming [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Nail</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-107</link>
		<dc:creator>James Nail</dc:creator>
		<pubDate>Tue, 10 May 2011 01:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-107</guid>
		<description>Well, @openid-33918:disqus , here&#039;s one that I had recently...
Real simple.  Click a button that begins a planned sales calling session (loads a CallingSession entity on the server and calls callingSession.StartTimer()).
OK, so it&#039;s obviously an UPDATE to the existing calling session, but it&#039;s just one of several different updates that could be applied to that session, and I&#039;m not really passing any info to update it with -- instead, I&#039;m invoking a behavioral method on the CallingSession entity.
Basically, I just want to fire off a command to start the session&#039;s timer in this case -- I don&#039;t want to modify the name of the session or any details like that.
So wouldn&#039;t it be much simpler if I had controller actions that worked like Command objects?
Now I know it&#039;s easy to just make an action called &quot;StartSessionTimer&quot; on my CallingSessionController (which is what I ended up doing, even though it didn&#039;t really fit the RESTful paradigm), but man, I gotta tell you, it didn&#039;t take long for that controller to get REALLY messy.</description>
		<content:encoded><![CDATA[<p>Well, @openid-33918:disqus , here&#8217;s one that I had recently&#8230;<br />
Real simple.  Click a button that begins a planned sales calling session (loads a CallingSession entity on the server and calls callingSession.StartTimer()).<br />
OK, so it&#8217;s obviously an UPDATE to the existing calling session, but it&#8217;s just one of several different updates that could be applied to that session, and I&#8217;m not really passing any info to update it with &#8212; instead, I&#8217;m invoking a behavioral method on the CallingSession entity.<br />
Basically, I just want to fire off a command to start the session&#8217;s timer in this case &#8212; I don&#8217;t want to modify the name of the session or any details like that.<br />
So wouldn&#8217;t it be much simpler if I had controller actions that worked like Command objects?<br />
Now I know it&#8217;s easy to just make an action called &#8220;StartSessionTimer&#8221; on my CallingSessionController (which is what I ended up doing, even though it didn&#8217;t really fit the RESTful paradigm), but man, I gotta tell you, it didn&#8217;t take long for that controller to get REALLY messy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Marisic</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-106</link>
		<dc:creator>Chris Marisic</dc:creator>
		<pubDate>Mon, 09 May 2011 19:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-106</guid>
		<description>@google-e1aef3bc7cbb476ef2df922fb219c4a6:disqus your comment&#039;s entire premise seems to surround this singular statement


&quot;but if your app is more behavioral in nature, and want to make a nice 
task-driven, domain-oriented UI for your app, you might suddenly find 
yourself beating your head against a wall&quot;


I think you need to elaborate on this more because I&#039;ve never had an app where I found myself beating my head against the wall trying to decide what controller an action goes into.
</description>
		<content:encoded><![CDATA[<p>@google-e1aef3bc7cbb476ef2df922fb219c4a6:disqus your comment&#8217;s entire premise seems to surround this singular statement</p>
<p>&#8220;but if your app is more behavioral in nature, and want to make a nice<br />
task-driven, domain-oriented UI for your app, you might suddenly find<br />
yourself beating your head against a wall&#8221;</p>
<p>I think you need to elaborate on this more because I&#8217;ve never had an app where I found myself beating my head against the wall trying to decide what controller an action goes into.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-105</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 05 May 2011 19:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-105</guid>
		<description>There have been several questions regarding how this relates to the SRP for controllers, so I may try to do a separate post to explain this topic further.

In brief, controllers are for accessing the domain, not for modeling the domain.  Controllers are essentially message handlers.  Their purpose is to translate signals from the user (HTTP requests in the case of Web applications) into interactions with the application.  Therefore, the cohesiveness of each controller is measured with respect to its role as a message handler, not with respect to the cohesiveness of the behaviors it interfaces with.

As a point of pragmatism,  I think its fine to group all the message handling which relates to a single model within your application for basic CRUD applications, or even for behavior-rich applications where the technical requirements for handling each of the messages happen to share the same dependencies.  That said, encapsulating the handling of each message into its own controller is a strategy you can apply uniformly for both simple and complex applications.

</description>
		<content:encoded><![CDATA[<p>There have been several questions regarding how this relates to the SRP for controllers, so I may try to do a separate post to explain this topic further.</p>
<p>In brief, controllers are for accessing the domain, not for modeling the domain.  Controllers are essentially message handlers.  Their purpose is to translate signals from the user (HTTP requests in the case of Web applications) into interactions with the application.  Therefore, the cohesiveness of each controller is measured with respect to its role as a message handler, not with respect to the cohesiveness of the behaviors it interfaces with.</p>
<p>As a point of pragmatism,  I think its fine to group all the message handling which relates to a single model within your application for basic CRUD applications, or even for behavior-rich applications where the technical requirements for handling each of the messages happen to share the same dependencies.  That said, encapsulating the handling of each message into its own controller is a strategy you can apply uniformly for both simple and complex applications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Marisic</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-104</link>
		<dc:creator>Chris Marisic</dc:creator>
		<pubDate>Thu, 05 May 2011 14:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-104</guid>
		<description>I feel it would be an anti-pattern because you&#039;re losing the grouping of logical code blocks. Using the single action controllers to me feels the same as if I&#039;d be designing a system where my domain was setup like

class Password { public string Password { get; set; }
class UserName { public string UserName { get; set; }
class Email { public string Email { get; set; }

I&#039;d much rather have

class User { password, username, email }</description>
		<content:encoded><![CDATA[<p>I feel it would be an anti-pattern because you&#8217;re losing the grouping of logical code blocks. Using the single action controllers to me feels the same as if I&#8217;d be designing a system where my domain was setup like</p>
<p>class Password { public string Password { get; set; }<br />
class UserName { public string UserName { get; set; }<br />
class Email { public string Email { get; set; }</p>
<p>I&#8217;d much rather have</p>
<p>class User { password, username, email }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Nail</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-103</link>
		<dc:creator>James Nail</dc:creator>
		<pubDate>Thu, 05 May 2011 14:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-103</guid>
		<description>Hi Chris,
I&#039;d like to hear your take on my comment below with respect to the impedance mismatch between the Restful Routing paradigm and the behavioral nature of a task-based UI.
I like restful routing, it&#039;s simple and elegant.  But for me, it&#039;s been quite painful to try to apply it in the context of an application featuring rich behavior (it&#039;s a really great fit for CRUD, though).</description>
		<content:encoded><![CDATA[<p>Hi Chris,<br />
I&#8217;d like to hear your take on my comment below with respect to the impedance mismatch between the Restful Routing paradigm and the behavioral nature of a task-based UI.<br />
I like restful routing, it&#8217;s simple and elegant.  But for me, it&#8217;s been quite painful to try to apply it in the context of an application featuring rich behavior (it&#8217;s a really great fit for CRUD, though).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-102</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 05 May 2011 02:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-102</guid>
		<description>Can you explain why you would consider this approach to be an anti-pattern?

Regarding your example,  you haven&#039;t set forth enough context to  make any claims about its cohesiveness or superiority to the classic Front Controller pattern.</description>
		<content:encoded><![CDATA[<p>Can you explain why you would consider this approach to be an anti-pattern?</p>
<p>Regarding your example,  you haven&#8217;t set forth enough context to  make any claims about its cohesiveness or superiority to the classic Front Controller pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Marisic</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-101</link>
		<dc:creator>Chris Marisic</dc:creator>
		<pubDate>Wed, 04 May 2011 14:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-101</guid>
		<description>I would honestly classify this as an anti-pattern of working with MVC. A much better solution is to adopt the Restful Routing paradigm (or create a personal variant for yourself) that controls establish a very concrete convention on the actions the controller will serve like

ContactsController
-Index
-Show
-Edit

At this point you have no violations of the SRP. The only reason the Contacts Controller will ever need to change is only if the manipulation of the Contact changes.</description>
		<content:encoded><![CDATA[<p>I would honestly classify this as an anti-pattern of working with MVC. A much better solution is to adopt the Restful Routing paradigm (or create a personal variant for yourself) that controls establish a very concrete convention on the actions the controller will serve like</p>
<p>ContactsController<br />
-Index<br />
-Show<br />
-Edit</p>
<p>At this point you have no violations of the SRP. The only reason the Contacts Controller will ever need to change is only if the manipulation of the Contact changes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-100</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 03 May 2011 18:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-100</guid>
		<description>The FubuMVC framework provides a more flexible and elegant approach to
achieving this capability, though the approach presented here is fairly
similar from a conceptual perspective (i.e. both rely upon custom routing
conventions for identifying action classes and method names).

As compared to the approach presented within Jeffery Palermo&#039;s article, this
approach allows you to configure which URLs you wish to route to action
classes, requires no custom controller factory configuration, and doesn&#039;t
require you to inherit from a custom controller base class.</description>
		<content:encoded><![CDATA[<p>The FubuMVC framework provides a more flexible and elegant approach to<br />
achieving this capability, though the approach presented here is fairly<br />
similar from a conceptual perspective (i.e. both rely upon custom routing<br />
conventions for identifying action classes and method names).</p>
<p>As compared to the approach presented within Jeffery Palermo&#8217;s article, this<br />
approach allows you to configure which URLs you wish to route to action<br />
classes, requires no custom controller factory configuration, and doesn&#8217;t<br />
require you to inherit from a custom controller base class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hoya Baptiste</title>
		<link>http://lostechies.com/derekgreer/2011/04/29/single-action-controllers-with-asp-net-mvc/#comment-99</link>
		<dc:creator>Hoya Baptiste</dc:creator>
		<pubDate>Tue, 03 May 2011 13:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://lostechies.com/derekgreer/?p=286#comment-99</guid>
		<description>What are the advantages of this approach compared to:

 &quot;Going Controller-less in MVC: The Way Fowler Meant It To Be&quot;
http://lostechies.com/chadmyers/2009/06/18/going-controller-less-in-mvc-the-way-fowler-meant-it/

or 

The ASP.NET MVC ActionController – The controllerless action, or actionless controller 
http://jeffreypalermo.com/blog/the-asp-net-mvc-actioncontroller-ndash-the-controllerless-action-or-actionless-controller/

The concepts behind them (SRP) are quite similar but the implementation is different. I agree that controllers can get &quot;heavy&quot; and I&#039;m looking at ways to simplify this.</description>
		<content:encoded><![CDATA[<p>What are the advantages of this approach compared to:</p>
<p> &#8220;Going Controller-less in MVC: The Way Fowler Meant It To Be&#8221;<br />
<a href="http://lostechies.com/chadmyers/2009/06/18/going-controller-less-in-mvc-the-way-fowler-meant-it/" rel="nofollow">http://lostechies.com/chadmyers/2009/06/18/going-controller-less-in-mvc-the-way-fowler-meant-it/</a></p>
<p>or </p>
<p>The ASP.NET MVC ActionController – The controllerless action, or actionless controller<br />
<a href="http://jeffreypalermo.com/blog/the-asp-net-mvc-actioncontroller-ndash-the-controllerless-action-or-actionless-controller/" rel="nofollow">http://jeffreypalermo.com/blog/the-asp-net-mvc-actioncontroller-ndash-the-controllerless-action-or-actionless-controller/</a></p>
<p>The concepts behind them (SRP) are quite similar but the implementation is different. I agree that controllers can get &#8220;heavy&#8221; and I&#8217;m looking at ways to simplify this.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
