<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Shiju Varghese's Blog - All Comments</title><link>http://weblogs.asp.net/shijuvarghese/default.aspx</link><description>A .Net Ninja on  ASP.NET MVC, TDD and Architecture.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Debug Build: 20510.895)</generator><item><title>re: Introduction to Test-Driven Development with ASP.NET MVC</title><link>http://weblogs.asp.net/shijuvarghese/archive/2009/07/22/introduction-to-test-driven-development-with-asp-net-mvc.aspx#7231509</link><pubDate>Fri, 16 Oct 2009 16:03:50 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7231509</guid><dc:creator>Matthew Miller</dc:creator><description>&lt;p&gt;Whats the point of the Service class? &amp;nbsp;What is it&amp;#39;s single responsibility? &amp;nbsp;The first test highlights the issue. &amp;nbsp;You&amp;#39;re testing a controller that consumes the service class, yet all your mocks and expectations are set on the repository class.&lt;/p&gt;
&lt;p&gt;Indeed your SetUp method actually creates an instance of the service which means that your controller tests will test both the behavior of the service and the controller. &amp;nbsp;Any change to actual behavior in the service class would likely result in broken controller tests.&lt;/p&gt;
&lt;p&gt;In looking at the behavior encapsulated by the code I see only a single method that shouldn&amp;#39;t be on the repository or controller and that is the validation of the name. &amp;nbsp;Would saving a category to the DB with an empty name ever be a valid condition? &amp;nbsp;If not then the validation of the category should be moved to a place where this logic can be shared.&lt;/p&gt;
&lt;p&gt;Because the logic is so simple here, I would simply place the validation logic on the model directly, but for many more advanced scenarios the logic should be encapsulated on a different object. &amp;nbsp;The more advanced scenarios would then drive the creation of a Service object of some sort.&lt;/p&gt;
&lt;p&gt;Overall good explanation of TDD, but the service object is simply unnecessary for the example.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7231509" width="1" height="1"&gt;</description></item><item><title>Dependency injection (DI) &amp;laquo; Make Your Heart &amp;quot;ba-boom ba-boom&amp;quot; (????????????)</title><link>http://weblogs.asp.net/shijuvarghese/archive/2009/03/12/applying-dependency-injection-in-asp-net-mvc-nerddinner-com-application.aspx#7230690</link><pubDate>Thu, 15 Oct 2009 15:11:19 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7230690</guid><dc:creator>Dependency injection (DI) « Make Your Heart "ba-boom ba-boom" (????????????)</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Dependency injection (DI) &amp;amp;laquo; Make Your Heart &amp;amp;quot;ba-boom ba-boom&amp;amp;quot; (????????????)&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7230690" width="1" height="1"&gt;</description></item><item><title>re: Default option label for DropDownList in ASP.NET MVC Preview 5 </title><link>http://weblogs.asp.net/shijuvarghese/archive/2008/09/01/default-option-label-for-dropdownlist-in-asp-net-mvc-preview-5.aspx#7227691</link><pubDate>Mon, 12 Oct 2009 07:39:57 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7227691</guid><dc:creator>r4 firmware</dc:creator><description>&lt;p&gt;How do you get it so a blank option will show in the list? If I put a string.Empty there it doesn&amp;#39;t add the blank option.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7227691" width="1" height="1"&gt;</description></item><item><title>re: Default option label for DropDownList in ASP.NET MVC Preview 5 </title><link>http://weblogs.asp.net/shijuvarghese/archive/2008/09/01/default-option-label-for-dropdownlist-in-asp-net-mvc-preview-5.aspx#7225698</link><pubDate>Thu, 08 Oct 2009 19:19:10 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7225698</guid><dc:creator>cshellvb</dc:creator><description>&lt;p&gt;Ok when I first read this I was ready to complain :P &lt;/p&gt;
&lt;p&gt;I thought this empty string would break my Binding in the Controller method for int types that are linked to the drop down.&lt;/p&gt;
&lt;p&gt;Then I tested it real quick to get the error for complaining....&lt;/p&gt;
&lt;p&gt;Dangit - it returns 0, just like I wanted. &lt;/p&gt;
&lt;p&gt;Is this just some black magic in the background that is doing a cast from empty.string to 0 in the background ?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7225698" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC Grid View using MVCContrib</title><link>http://weblogs.asp.net/shijuvarghese/archive/2008/07/23/asp-net-mvc-grid-view-using-mvccontrib.aspx#7221653</link><pubDate>Fri, 02 Oct 2009 14:01:33 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7221653</guid><dc:creator>kmullings</dc:creator><description>&lt;p&gt;Thanks Shiju! &amp;nbsp;This is a BIG time saver.&lt;/p&gt;
&lt;p&gt;How can I use this for an inline &amp;quot;Add&amp;quot; function?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7221653" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC Tip: Dependency Injection with StructureMap</title><link>http://weblogs.asp.net/shijuvarghese/archive/2008/10/10/asp-net-mvc-tip-dependency-injection-with-structuremap.aspx#7216374</link><pubDate>Fri, 25 Sep 2009 12:32:35 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7216374</guid><dc:creator>nishant</dc:creator><description>&lt;p&gt;GR8 Man........&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7216374" width="1" height="1"&gt;</description></item><item><title>re: ASP.NET MVC Grid View using MVCContrib</title><link>http://weblogs.asp.net/shijuvarghese/archive/2008/07/23/asp-net-mvc-grid-view-using-mvccontrib.aspx#7213726</link><pubDate>Tue, 22 Sep 2009 06:27:07 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7213726</guid><dc:creator>Suresh</dc:creator><description>&lt;p&gt;In aspx page mentioned &amp;nbsp;Html.Grid&amp;lt;Category&amp;gt;. What is this &amp;lt;Category&amp;gt; Please tell me.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7213726" width="1" height="1"&gt;</description></item><item><title>re: ASP.net MVC Vs ASP.net Web Form</title><link>http://weblogs.asp.net/shijuvarghese/archive/2008/07/09/asp-net-mvc-vs-asp-net-web-form.aspx#7201926</link><pubDate>Sat, 12 Sep 2009 06:01:05 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7201926</guid><dc:creator>shiju</dc:creator><description>&lt;p&gt;@Manoj You can possible to use multiple submit buttons. Check this link &lt;a rel="nofollow" target="_new" href="http://stackoverflow.com/questions/442704/how-do-you-handle-multiple-submit-buttons-in-asp-net-mvc-framework"&gt;stackoverflow.com/.../how-do-you-handle-multiple-submit-buttons-in-asp-net-mvc-framework&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7201926" width="1" height="1"&gt;</description></item><item><title>re: ASP.net MVC Vs ASP.net Web Form</title><link>http://weblogs.asp.net/shijuvarghese/archive/2008/07/09/asp-net-mvc-vs-asp-net-web-form.aspx#7200623</link><pubDate>Fri, 11 Sep 2009 10:39:37 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7200623</guid><dc:creator>Manoj</dc:creator><description>&lt;p&gt;I am new to MVC and haven&amp;#39;t formed an opinion or take decision on which way is better. With MVC, is it possible to find what caused the Post to occur considering I have multiple submit buttons (each one doing a separate action at the server end) on the form.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7200623" width="1" height="1"&gt;</description></item><item><title>re: ASP.net MVC Vs ASP.net Web Form</title><link>http://weblogs.asp.net/shijuvarghese/archive/2008/07/09/asp-net-mvc-vs-asp-net-web-form.aspx#7197038</link><pubDate>Wed, 09 Sep 2009 01:35:04 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7197038</guid><dc:creator>jason</dc:creator><description>&lt;p&gt;right&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7197038" width="1" height="1"&gt;</description></item></channel></rss>