Hi Levi,
levib:
gerrylowry:Brad, how would I know this if I was not lucky enough to have you to mention it? Please, can you point me to where this is documented?
Can you point to where it is documented that you
can have method overloads without a disambiguator? :)
Short answer: no. B-(
Almost every day, I get a small gain in my understanding. Sometimes the MSDN library information is useful to me. Often, it's way too sparse.
Examples:
http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult.aspx
http://msdn.microsoft.com/en-us/library/system.web.mvc.actionresult_members.aspx
Sometimes, if I'm lucky, I can read between the lines.
levib:Can you point to where it is documented that you can have method overloads without a disambiguator? :)
Levi, imo,
it would be absolutely heavenly wonderful if there was
extensive, methodically annotated documentation that described both what the developer
can and
can not do.
I'm not suggesting silliness such as "you can not bake a cake with ASP.NET MVC". Rather, I'm suggesting things that members of the ASP.NET MVC team take for granted but other developers do not yet understand.
levib:Every time there is a sample with method overloads, there is always an attribute accompanying at least one of the methods.
By "sample", I assume you mean, among other things, tutorial.
Please compare, for example, the movie database tutorial* with my annotations at http://forums.asp.net/t/1401522.aspx.
* Creating a Movie Database Application with ASP.NET MVC (C#) http://www.asp.net/learn/mvc/tutorial-21-cs.aspx
Phil, the two Scott's, Rod, and others in your league do not need these annotations. They are already etched in the experience fountain within your fine minds. OTOH, the gerry lowrys of the world deeply need the kind of documentation that people in your league often know intuitively.
levib:Being able to differentiate methods based on signature alone is something we looked at, but the end result is that the design would have been unimaginably complex and the behavior too unpredictable. Which is a shame, since developers who are used to C# or VB are already familiar with this syntax. :(
Levi, I wish I understood the complexities that you mention here. I also wish I understood the compilition process better. In my 40+ years of programming, I've spent way too much time programming in way too many languages and way too little time programming in just one language.
I was blown away when the compiler told me that my two signatures were ambiguous because they did not look abiguous to me.
bradwils:There is "ambiguous to the language", which they are not, and there is "ambiguous to the routing system, which has to pick an action method based on the URL", which they are. A URL is not a method call, and therefore you can't just apply the same logic that your compiler can to pick between the two methods.
Levi, Brad: so, is the compiler actually somehow applying rules that are ASP.NET MVC rules to the compilation?
(I'm not certain, but, if my recollection is correct, it was "the compiler" that told me my two signatures were ambiguous.)
bradwils:Since we don't have the compiler to help us, MVC enforces some rules about mapping URLs to action methods, and they have nothing to do with the parameters to those methods; rather, we rely on attributes to disambiguate the usage.
? does this mean that the attributes are communicating with the compiler to extend the compiler?
Gerry
P.S.: Levi, Brad, anyone ~~ please see my previous post to this thread.
I still can not figure out how to round trip the selected list value back to the "HighlightsIndex.aspx" so that I can somehow use as per the pseudo if statements in my previous post.
Any ideas?
Gerry Lowry, Principal
Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
68 John W. Taylor Avenue
Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com
Websites:
http://abilitybusinesscomputerservices.comhttp://gerrylowryprogrammer.com ~~
résumé & testimonials
http://veganoccasions.com ~~ recipes by
Susan