Refactoring toward frictionless & odorless codeA broken home (controller)
Originally posted at 3/30/2011
Previous, our HomeController looked like this:
public class HomeController : SessionController { public ActionResult Blog(int id) { var blog = Session.Get<Blog>(id); return Json(blog, JsonRequestBehavior.AllowGet); } }
My model is defined as:
Remember that the previous post we have changed the session management from the request scope to the action scope?
Well, that meant that we have just broken this code…
But can you see how?
More posts in "Refactoring toward frictionless & odorless code" series:
- (12 Apr 2011) What about transactions?
- (11 Apr 2011) Getting rid of globals
- (10 Apr 2011) The case for the view model
- (09 Apr 2011) A broken home (controller)
- (08 Apr 2011) Limiting session scope
- (07 Apr 2011) Hiding global state
- (06 Apr 2011) The baseline

Comments
Comment preview