Route Sequence in ASP.NET MVC

by john 3/25/2008 9:09:00 PM

While testing out some of the new features of the March preview of ASP.NET MVC, I found an interesting feature of the routing behavior.  (alternative suggestions welcome)

Suppose you want to setup the route http://mywebsite/login but your default route in global.asax.cs is:

routes.Add(new Route("{controller}/{action}/{id}", new MvcRouteHandler())
            {
                Defaults = new RouteValueDictionary(new { action = "Index", id = "" }),
            });

 

How about adding?

  routes.Add(new Route("login", new MvcRouteHandler())
            {
                Defaults = new RouteValueDictionary(new { controller = "Security", action = "Login", id = (string)null }),
            });

 

Lest you find yourself throwing things and brushing up on your Jr. High vocabulary, note that the the default behavior (at least for now) is matching in order that the routes are added.  First match wins.  So, if you add the  new route after the first, your url will get caught in the first route pattern and may violate your expectations.

 A great way to look at mvc routes is to download the route debugger which is a dll and one line of debug code to give you this:

 

Currently rated 4.3 by 3 people

  • Currently 4.333333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET MVC Framework

iMac - OS X - Leopard vs. The PC and Vista

by john 2/5/2008 8:46:00 AM

I'm primarily a PC guy, but I've used Macs over the years.  My latest addition is an iMac with a 20 inch monitor and built in hardware.  It's a piece of art as much as hardware.  I miss the 747-like CPU fan on my PC like a rash.  Here's a quick summary after two weeks of how things stack up, on one view:

To the Mac:

1) Style - it's not just a meritocracy - remember Jaguar?

2) Hardware integration - nothing to think about - nothing.

3) Music and video editing - brillant built in applications and hardware integration

4) Shell access - it's Linux

5) User interface - a slight edge here

6) Performance - partly to do with less software availability, but generally true 

7) Form factor - I now live with less noise, wires, plugs, etc.

To the Vista PC:

1) Software - there's lots more of it

2) Programming - you're boxed in to web apps, Objective C, or sometimes updated Java on the Mac

3) Office - it doesn't compare on the Mac

4) Reliability

 I don't think there's anything remarkable here, expect #4, and I'd say that's the the primary reason I won't start buying iMacs for the office.  I've "Forced Quit" too many times over the past few weeks for my liking.  I think there is a misperception that apps written for OS X are more stable, but I'd say, anecdotally, that this is not true.  Among the crashers: mail, XCode, and Firefox.  I believe I managed to crash the OS as well.  (Grey screen, giant apple, hardware unresponsive)

 

Currently rated 3.5 by 2 people

  • Currently 3.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Mac

Daniel Dennett

by john 1/10/2008 11:18:00 PM

Dennett's arguments against greedy reductionism - something to the effect that human behavior is just the terminus of evolution and natural selection - leads nicely into his chapter On The Origin of Morality.  (Darwin's Dangerous Idea - Chapter 17).  Dennett lays out the framework of the question succinctly:

"Mathematics and physics are the same for everyone everywhere, but ethics has not yet settled into a similar reflective equilibrium.  Why not?  Is the goal illusory?  Is morality just a matter of subjective taste (and political power)?  Are there no discoverable and confirmable ethical truths, no forced moved or Good Tricks?  Great edifices of ethical theory have  been constructed, criticized and defended, revised and extended by the best methods of rational inquiry, and among these artifacts of human reasoning are some of the most magnificent creations of culture, but they do not yet command the untroubled ascent of all those who have studied them carefully."

 I was looking forward to Dennett's chapter on ethics much like I enjoy seeing a star athlete substituted in for a normal player - he has a great capacity for navigating some difficult territory.  I doubt, however, that Dennett would claim that anything in the chapter dents the framework of uncertainty that he detailed above.   In fact, we move rather dismissively through Utilitarianism and the Kantian Categorical Imperative into a somewhat meandering discussion of how decisions with ethical implications actually do proceed. 

Time constraints, psychology, self-doubt, and conversation stoppers are key ingredients in detailing ethical stories for Dennett.  The conversation stopper such as, "That would do more harm than good" leads to "temporary equilibria" in a shared decision making process with ethical implications, and it is these meta-memes, and the process wherein society defines them, that warrants our attention. 

So, Dennett tells us not to despair: the complexities of how real ethical questions unfold over time, and the ambiguity in applying maxims in such circumstances, practically, and probably theoretically, prohibit an a priori maxim or framework from being of the cornerstone of our decision making in these matters, but that, despite greedy reductionist attempts, the meta-memes we create are sufficient.  We are ever-searching for better solutions to our ethical issues and that creates our ethical foundation.

I think there is still quite a bit to despair of here: whose meta-memes and why?  The dismissal of the Categorical Imperative - the test of universal law for any decision - is based on there being too many candidate maxims, although Dennett stresses the temporality of ethical decision making.  He hasn't convincingly dismissed the Categorical Imperative, on my view.

 

 

 

 

 

 

 

 

 

 

 

Currently rated 2.0 by 1 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Ethics | Philosophy

Daniel Dennett's Central Tenent

by John 12/1/2007 8:21:00 PM

I'm reading Daniel Dennett's Darwin's Dangerous Idea.  His writing is vivid and concise and navigates some really challenging topics.   It's too early in the book for cursory summations, but some of his early argumentative efforts are spent trumpeting the superiority of evolutionary biology vs. master-planner ideologies.  It's an interesting effort, and it's partially interesting because he wields the tools of analytic philosophy and tirelessly explores the master-planner ideas when most people who concur with his thinking quietly, and politely, walk away from such discussions.   About 1/3 of the way though the book, however, I think he is performing an "and that's all there is to it" manuver that is employed fairly frequently in contempory philosophy.  And, I do mean manuver, not fallacy.  In other words, you lay out an explanation and sever the motivation for the question - it's very Wittgenstein.  Dennett seems to say, "and evolution is the explanation for the the human condition, period, go away." 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  July 2008  >>
MoTuWeThFrSaSu
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar

Pages

Recent posts

Recent comments

Don't show

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in