﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Michael commented on Configuration over Convention</title><description>Did you see Phil Haack's post on his ConventionController?
  
  
http://haacked.com/archive/2007/12/09/extending-asp.net-mvc-to-add-conventions.aspx
  
  
Basically, descending from ConventionController rather that Controller allows you to bypass all the attributes for you methods.
</description><link>http://ayende.com/3021/configuration-over-convention#comment14</link><guid>http://ayende.com/3021/configuration-over-convention#comment14</guid><pubDate>Mon, 10 Dec 2007 15:26:44 GMT</pubDate></item><item><title>goodwill commented on Configuration over Convention</title><description>I have a feeling most of you guys haven't coded a project on MonoRail/Ruby on Rails. Convention over Configuration IS VERY IMPORTANT. The point is not just wrist pain (which I am suffering already), its the neatness of debugging. When you have something 95% you need to do and you keep coding it again and again that naturally means you are giving pain to your developer fellows to understand the code later. Thats what we blamed about MS Patterns (e.g. Exception vs Log4Net, Object Builder versus Castle Windsor), and Spring (thats how people love Rails). 
  
  
When you want to know its important or not, try the other side first is very important step to justify.
</description><link>http://ayende.com/3021/configuration-over-convention#comment13</link><guid>http://ayende.com/3021/configuration-over-convention#comment13</guid><pubDate>Mon, 10 Dec 2007 13:49:54 GMT</pubDate></item><item><title>John &amp;quot;Z-Bo&amp;quot; Zabroski commented on Configuration over Convention</title><description>I never really considered "coddling developers" as being contradictory to usability, but it makes a fair amount of sense.  If the habits of your developers becomes a literal embodiment in your architecture, then you've changed the external problem domain to include developers habits in addition to user habits.  Makes sense.
  
  
My thanks go out to Ayende and Matt Berther.
</description><link>http://ayende.com/3021/configuration-over-convention#comment12</link><guid>http://ayende.com/3021/configuration-over-convention#comment12</guid><pubDate>Sun, 09 Dec 2007 01:42:12 GMT</pubDate></item><item><title>pat@veloc-no-spam-porfavor-it.com (Pat Gannon) commented on Configuration over Convention</title><description>I agree with Sergio - a class level attribute to change the default would be the best way to go...  If they just made all methods accessible by default, everyone would jump on the 'MS MVC is not secure' bandwagon as soon as some dimwit's site got hacked because of this.
</description><link>http://ayende.com/3021/configuration-over-convention#comment11</link><guid>http://ayende.com/3021/configuration-over-convention#comment11</guid><pubDate>Sun, 09 Dec 2007 00:37:39 GMT</pubDate></item><item><title>Sergio Pereira commented on Configuration over Convention</title><description>In this particular case I'd have to disagree with the complaint and side with the chosen approach. Maybe a class-level attribute that "opens up" the public methods by default could help remedy this situation but I still think methods should be unavailable by default.
  
This is a valuable lesson learned form other frameworks (even RoR) that cause apps to expose methods as actions by accident. 
  
I'm not convinced that all public methods in a controller must be actions but I'm willing to change my mind after I have a chance to build non-trivial stuff on it.
  
  
  
</description><link>http://ayende.com/3021/configuration-over-convention#comment10</link><guid>http://ayende.com/3021/configuration-over-convention#comment10</guid><pubDate>Sat, 08 Dec 2007 23:04:14 GMT</pubDate></item><item><title>Luke Breuer commented on Configuration over Convention</title><description>In practice, is it easy to have everything that shouldn't be accessible, not on a controller?  I'm talking for decently complex MVC apps, not toy examples that explain nothing other than syntax.
  
  
A solution for Microsoft would be to have FxCop chew you out if you don't write tests (which are clearly testing a browser hitting that method, if this makes sense) for all the non-hidden methods on a controller.
  
  
There's something to be said for enabling a "pit of success".  I clearly recall Scott Guthrie explaining that would could alter the defaults by creating "some class" that would take care of all this stuff.  It seems that you would want to override other issues as well, so why again is this a huge issue?
</description><link>http://ayende.com/3021/configuration-over-convention#comment9</link><guid>http://ayende.com/3021/configuration-over-convention#comment9</guid><pubDate>Sat, 08 Dec 2007 02:25:20 GMT</pubDate></item><item><title>Matt Berther commented on Configuration over Convention</title><description>Just to clarify: my comment was supposed to say
  
  
If concerns are separated something that should *not* be accessible shouldnt be on the controller.
  
  
</description><link>http://ayende.com/3021/configuration-over-convention#comment8</link><guid>http://ayende.com/3021/configuration-over-convention#comment8</guid><pubDate>Sat, 08 Dec 2007 01:05:23 GMT</pubDate></item><item><title>Ayende Rahien commented on Configuration over Convention</title><description>Matt,
  
Precisely.
</description><link>http://ayende.com/3021/configuration-over-convention#comment7</link><guid>http://ayende.com/3021/configuration-over-convention#comment7</guid><pubDate>Sat, 08 Dec 2007 00:58:36 GMT</pubDate></item><item><title>Matt Berther commented on Configuration over Convention</title><description>@ayende: I posted about this myself over at my blog a while back and the response that I got was that this was because of a security thing that prevents unknowing developers from opening up their application to the world.
  
  
My response: so, Microsoft continues to coddle developers who cannot properly factor an application. System.MVC is *SUPPOSED* to promote separation of concerns. If concerns are separated, something that should be accessible shouldnt be on the controller.
  
  
http://www.mattberther.com/2007/11/16/systemwebmvc-and-attribute-declarations-for-controllers/
  
  
</description><link>http://ayende.com/3021/configuration-over-convention#comment6</link><guid>http://ayende.com/3021/configuration-over-convention#comment6</guid><pubDate>Sat, 08 Dec 2007 00:55:31 GMT</pubDate></item><item><title>Ayende Rahien commented on Configuration over Convention</title><description>That is assigning the work to someone else.
  
Defaults matter.
</description><link>http://ayende.com/3021/configuration-over-convention#comment5</link><guid>http://ayende.com/3021/configuration-over-convention#comment5</guid><pubDate>Sat, 08 Dec 2007 00:55:05 GMT</pubDate></item><item><title>Ayende Rahien commented on Configuration over Convention</title><description>That is assigning the work to someone else.
  
Defaults matter.
</description><link>http://ayende.com/3021/configuration-over-convention#comment4</link><guid>http://ayende.com/3021/configuration-over-convention#comment4</guid><pubDate>Sat, 08 Dec 2007 00:55:03 GMT</pubDate></item><item><title>Jonathan de Halleux commented on Configuration over Convention</title><description>Then, just make sure that the mechanism to 'reflect' controller action is extendible and plugin your own logic.
</description><link>http://ayende.com/3021/configuration-over-convention#comment3</link><guid>http://ayende.com/3021/configuration-over-convention#comment3</guid><pubDate>Sat, 08 Dec 2007 00:34:24 GMT</pubDate></item><item><title>Ayende Rahien commented on Configuration over Convention</title><description>Why do you think that typing and wrist pain are not important?
  
I would have the same issue with [WebMethod], if there was another WS framework that said that anything public on a class inheriting from a WebService is a web method.
  
  
Explicit is not a good thing because the highly common case means that you are going to specify something that the framework can do for you. For me, this means that I need to do work for the framework, instead of the other way around.
  
  
Make sure that the teddy has a green jacket and a red tie, please.
</description><link>http://ayende.com/3021/configuration-over-convention#comment2</link><guid>http://ayende.com/3021/configuration-over-convention#comment2</guid><pubDate>Sat, 08 Dec 2007 00:31:42 GMT</pubDate></item><item><title>Rob Conery commented on Configuration over Convention</title><description>The pain I was talking about was typing and your wrists :). I don't see an issue with [ControllerAction] really - it's nice and safe and follows the same pattern as WebMethod.
  
  
Burdens, pain, hurting... geez you'd think we're talking about substance abuse here. Give me a good reason why being Explicit is not a good thing (in the case of RenderView).
  
  
Also - I'm sending some happy juice and a teddy bear to you :). I think you need a hug :):).
</description><link>http://ayende.com/3021/configuration-over-convention#comment1</link><guid>http://ayende.com/3021/configuration-over-convention#comment1</guid><pubDate>Sat, 08 Dec 2007 00:25:23 GMT</pubDate></item></channel></rss>